BIGTOP-3009. Add gradle repo-ind (#460)
authorEvans Ye <evansye@apache.org>
Sun, 3 Feb 2019 06:52:43 +0000 (14:52 +0800)
committerGitHub <noreply@github.com>
Sun, 3 Feb 2019 06:52:43 +0000 (14:52 +0800)
packages.gradle

index ac2c430..0253f1c 100644 (file)
@@ -795,3 +795,21 @@ if (nativePackaging) {
       description: "Invoking a native repository target ${nativePackaging.repo}",
       group: PACKAGES_GROUP) doLast { }
 }
+
+task "repo-ind" (
+    description: "Invoking a native repository in Docker. Usage: \$ ./gradlew " +
+            "-POS=[centos-7|fedora-26|debian-9|ubuntu-16.04|opensuse-42.3] " +
+            "-Pprefix=[trunk|1.2.1|1.2.0|1.1.0|...] repo-ind",
+    group: PACKAGES_GROUP) doLast {
+  def _prefix = project.hasProperty("prefix") ? prefix : "trunk"
+  def _OS = project.hasProperty("OS") ? OS : "centos-7"
+  def command = [
+      'docker', 'run', '--rm', '--volume', BASE_DIR + ':/bigtop-home', '--workdir', '/bigtop-home',
+      'bigtop/slaves:' + _prefix + '-' + _OS,
+      './gradlew', 'repo'
+  ]
+  exec {
+    workingDir BASE_DIR
+    commandLine command
+  }
+}