From 6d93a521ca6efa3503fa7b7186a3cb1c83fca7a0 Mon Sep 17 00:00:00 2001 From: Vincent Hou Date: Tue, 20 Mar 2018 16:48:23 -0400 Subject: [PATCH 1/2] Add the support to specify the version of the binaries This PR changes the task name from release to releaseBinaries in order to make it consistent in the release process. It also adds packageVersion as a parameter to specify the version of the binaries to be released. Partially-closes: apache/incubator-openwhisk-release#9 --- .travis.yml | 2 +- build.gradle | 13 +++++++++---- tools/travis/test_openwhisk.sh | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ecf33c48..7e848131c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,7 @@ script: - cd $TRAVIS_BUILD_DIR/../incubator-openwhisk - ./gradlew install - cd $TRAVIS_BUILD_DIR - - ./gradlew --console=plain release + - ./gradlew --console=plain releaseBinaries - ./tools/travis/test_openwhisk.sh after_success: diff --git a/build.gradle b/build.gradle index 2f46836ce..1fde42321 100644 --- a/build.gradle +++ b/build.gradle @@ -61,6 +61,7 @@ class OpenWhiskPlatform { The 'zipFileName' property is the root file name to use for archives. */ static String zipFileName + static String packageVersion /* Create a platform for the local platform @@ -121,6 +122,10 @@ OpenWhiskPlatform.zipFileName = System.env['zip_file_name'] ?: (rootProject.findProperty('zipFileName') ?: 'OpenWhisk_CLI') +OpenWhiskPlatform.packageVersion = + System.env['packageVersion'] ?: + (rootProject.findProperty('packageVersion') ?: 'latest') + String buildFileName = System.env['build_file_name'] ?: (rootProject.findProperty('buildFileName') ?: 'wsk') @@ -214,7 +219,7 @@ task individualArchives( type: (p.goOs == 'linux') ? Tar : Zip, dependsOn: compile) { if (p.goOs == 'linux') { compression = Compression.GZIP } destinationDir = file('./release') - baseName = "${p.zipFileName}-latest-${p.owOs}-${p.goArch}" + baseName = "${p.zipFileName}-${p.packageVersion}-${p.owOs}-${p.goArch}" from "./build/${p.goOs}-${p.goArch}/" include "${buildFileName}*" } @@ -243,14 +248,14 @@ task index() { } } -task release(type: Tar, dependsOn: [individualArchives, index]) { +task releaseBinaries(type: Tar, dependsOn: [individualArchives, index]) { compression = Compression.GZIP destinationDir = file('./release') - baseName = "${OpenWhiskPlatform.zipFileName}-latest-all" + baseName = "${OpenWhiskPlatform.zipFileName}-${OpenWhiskPlatform.packageVersion}-all" from('./build/content.json') { into('.') } rootProject.platforms.each() { p -> from('./release/') { - include("${p.zipFileName}-latest-${p.owOs}-${p.goArch}.*") + include("${p.zipFileName}-${p.packageVersion}-${p.owOs}-${p.goArch}.*") into p.archiveDirName rename { p.archiveFileName } } diff --git a/tools/travis/test_openwhisk.sh b/tools/travis/test_openwhisk.sh index 8d2453eec..78b3b78cd 100755 --- a/tools/travis/test_openwhisk.sh +++ b/tools/travis/test_openwhisk.sh @@ -7,7 +7,7 @@ set -e # the release. If you're running manually, this command should get you to # the same place: # -# ./gradlew release +# ./gradlew releaseBinaries # # Also at this point, you should already have incubator-openwhisk pulled down # from gradle in the parent directory, using a command such as: From d27ee81d5af593f5454b2d823a1eac8899e109c7 Mon Sep 17 00:00:00 2001 From: Vincent Hou Date: Wed, 21 Mar 2018 10:36:24 -0400 Subject: [PATCH 2/2] Make the parameter "packageVersion" a project extention --- build.gradle | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 1fde42321..1ea0fd530 100644 --- a/build.gradle +++ b/build.gradle @@ -61,7 +61,6 @@ class OpenWhiskPlatform { The 'zipFileName' property is the root file name to use for archives. */ static String zipFileName - static String packageVersion /* Create a platform for the local platform @@ -122,9 +121,8 @@ OpenWhiskPlatform.zipFileName = System.env['zip_file_name'] ?: (rootProject.findProperty('zipFileName') ?: 'OpenWhisk_CLI') -OpenWhiskPlatform.packageVersion = - System.env['packageVersion'] ?: - (rootProject.findProperty('packageVersion') ?: 'latest') +project.ext.packageVersion = + rootProject.findProperty('packageVersion') ?: 'latest' String buildFileName = System.env['build_file_name'] ?: (rootProject.findProperty('buildFileName') ?: 'wsk') @@ -219,7 +217,7 @@ task individualArchives( type: (p.goOs == 'linux') ? Tar : Zip, dependsOn: compile) { if (p.goOs == 'linux') { compression = Compression.GZIP } destinationDir = file('./release') - baseName = "${p.zipFileName}-${p.packageVersion}-${p.owOs}-${p.goArch}" + baseName = "${p.zipFileName}-${packageVersion}-${p.owOs}-${p.goArch}" from "./build/${p.goOs}-${p.goArch}/" include "${buildFileName}*" } @@ -251,11 +249,11 @@ task index() { task releaseBinaries(type: Tar, dependsOn: [individualArchives, index]) { compression = Compression.GZIP destinationDir = file('./release') - baseName = "${OpenWhiskPlatform.zipFileName}-${OpenWhiskPlatform.packageVersion}-all" + baseName = "${OpenWhiskPlatform.zipFileName}-${packageVersion}-all" from('./build/content.json') { into('.') } rootProject.platforms.each() { p -> from('./release/') { - include("${p.zipFileName}-${p.packageVersion}-${p.owOs}-${p.goArch}.*") + include("${p.zipFileName}-${packageVersion}-${p.owOs}-${p.goArch}.*") into p.archiveDirName rename { p.archiveFileName } }