-
Notifications
You must be signed in to change notification settings - Fork 999
Add a build qualifier system property to the build #1215
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
Changes from all commits
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 |
---|---|---|
|
@@ -10,17 +10,31 @@ boolean localRepo = project.getProperties().containsKey("localRepo") | |
|
||
Properties props = new Properties() | ||
props.load(project.file('esh-version.properties').newDataInputStream()) | ||
version = props.getProperty('eshadoop') | ||
String eshVersion = props.getProperty('eshadoop') | ||
String esVersion = props.getProperty('elasticsearch') | ||
|
||
// determine if we're building a prerelease or candidate (alphaX/betaX/rcX) | ||
// TODO: This default should be removed when ES stops using alpha1 as its default qualifier | ||
String qualifier = System.getProperty("build.version_qualifier", "alpha1") | ||
if (qualifier.isEmpty() == false) { | ||
if (qualifier.matches("(alpha|beta|rc)\\d+") == false) { | ||
throw new IllegalStateException("Invalid qualifier: " + qualifier) | ||
} | ||
eshVersion += "-" + qualifier | ||
esVersion += "-" + qualifier | ||
} | ||
|
||
// determine if we're building a snapshot or not (by default we will be) | ||
boolean snapshot = "true".equals(System.getProperty("build.snapshot", "true")) | ||
if (snapshot) { | ||
// we update the version property to reflect if we are building a snapshot or a release build | ||
version += "-SNAPSHOT" | ||
props.put("eshadoop", version) | ||
eshVersion += "-SNAPSHOT" | ||
esVersion += "-SNAPSHOT" | ||
} | ||
|
||
props.put("eshadoop", eshVersion) | ||
props.put("elasticsearch", esVersion) | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
|
@@ -45,7 +59,7 @@ dependencies { | |
compile 'org.springframework.build.gradle:propdeps-plugin:0.0.7' | ||
|
||
if (localRepo) { | ||
compile name: "build-tools-${version}" | ||
compile name: "build-tools-${esVersion}" | ||
} else { | ||
compile group: 'org.elasticsearch.gradle', name: 'build-tools', version: esVersion | ||
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. This forces the qualified ES to exist in the remote repo prior to allowing this build to succeed... is that intentional ?
will not build until ES alpha1 (not snapshot) is available on the remote repo, in the prior version, it was controlled solely by the property which, (to me) is unclear if this is a change in the behavior/workflow for the release. 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. Further up in the script the 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. Thanks for the explains! |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
eshadoop = 7.0.0-alpha1 | ||
elasticsearch = 7.0.0-alpha1-SNAPSHOT | ||
eshadoop = 7.0.0 | ||
elasticsearch = 7.0.0 |
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.
Does the release manager need to be aware of this system property ?
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.
There's a separate PR open for updating the release automation with the new qualifier code.