-
Notifications
You must be signed in to change notification settings - Fork 99
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per my comment above, this can become There was a problem hiding this comment. Choose a reason for hiding this commentThe 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') | ||
|
||
|
@@ -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 } | ||
} | ||
|
There was a problem hiding this comment.
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.
andp.
below.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx. Done.