Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 18 additions & 4 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Contributor

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 ?

Copy link
Member Author

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.

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()
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?
For example

./gradlew clean assemble -Dbuild.version_qualifier=alpha1 -Dbuild.snapshot=false

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Further up in the script the localRepo variable is set from the system properties. The localRepo property is used to configure a local directory as a repository for resolving project dependencies. During the release process, Elasticsearch is built first and the resulting build tools artifact is copied to the localRepo directory in the ES-Hadoop project. This way ES-Hadoop can depend on the exact same artifact that will be released by the same build. Those setup steps and scripts are managed outside this script by the release automation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the explains!

}
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/esh-version.properties
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