Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the support to specify the version of the binaries #251

Merged
merged 2 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 9 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class OpenWhiskPlatform {
The 'zipFileName' property is the root file name to use for archives.
*/
static String zipFileName
static String packageVersion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this belongs a project extension rather than an attribute of OpenWhiskPlatform. Platform really is intended to deal solely with the process/os aspects of the build and is less volatile than version.

Additional thought on why this is important — I think it would be a Bad Idea (but possible and implicitly supported) to build different version numbers for different architectures if we set the packageVersion for each platform.

That means taking off the OpenWhisk. and p. below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. Done.


/*
Create a platform for the local platform
Expand Down Expand Up @@ -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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per my comment above, this can become project.ext.packageVersion =. Also, I’m not sure I’d use an environment variable because it hides the “I’m building a release now” from the command line. If we have a variable set in a Travis build, we should pass it on the command line as the build parameter (as you provide here).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I remove the configuration as a system env.


String buildFileName = System.env['build_file_name'] ?:
(rootProject.findProperty('buildFileName') ?: 'wsk')

Expand Down Expand Up @@ -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}*"
}
Expand Down Expand Up @@ -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 }
}
Expand Down
2 changes: 1 addition & 1 deletion tools/travis/test_openwhisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down