-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSSRH-82400 Publish to Sonatype Open Source Project Repository
- Loading branch information
1 parent
5381e23
commit 0c520a4
Showing
4 changed files
with
144 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/env groovy | ||
|
||
pipeline { | ||
agent { | ||
label 'slave-group-release' | ||
} | ||
|
||
parameters { | ||
string(name: 'version', defaultValue: '0.0.0.Qualifier', description: 'Release version') | ||
string(name: 'nextVersion', defaultValue: '', description: 'Next release (blank to stay on current SNAPSHOT)') | ||
gitParameter(name: 'branch', defaultValue: 'origin/master', branchFilter: 'origin/(.*)', type: 'PT_BRANCH', description: 'Branch to release from') | ||
} | ||
|
||
options { | ||
timeout(time: 1, unit: 'HOURS') | ||
timestamps() | ||
buildDiscarder(logRotator(numToKeepStr: '10', daysToKeepStr: '61')) | ||
} | ||
|
||
stages { | ||
stage('Prepare') { | ||
steps { | ||
script { | ||
env.MAVEN_HOME = tool('Maven') | ||
env.MAVEN_OPTS = "-Xmx1g -XX:+HeapDumpOnOutOfMemoryError" | ||
env.JAVA_HOME = tool('JDK 11') | ||
} | ||
|
||
sh returnStdout: true, script: 'cleanup.sh' | ||
} | ||
} | ||
|
||
stage('Checkout') { | ||
steps { | ||
checkout scm | ||
} | ||
} | ||
|
||
stage('Version') { | ||
steps { | ||
sh "$MAVEN_HOME/bin/mvn -B -V versions:set -DnewVersion=${version} -DprocessAllModules=true" | ||
sh "$MAVEN_HOME/bin/mvn -B -V versions:set-property -Dproperty=version.infinispan -DnewVersion=${version}" | ||
} | ||
} | ||
|
||
stage('Deploy') { | ||
steps { | ||
sh "$MAVEN_HOME/bin/mvn -B -V -Pcommunity-release -DskipTests clean deploy -DstagingRepositoryId=$STAGING_REPO_ID" | ||
} | ||
} | ||
|
||
stage('Tag') { | ||
steps { | ||
// Commit and tag once everything is good | ||
sh "$MAVEN_HOME/bin/mvn -B -V scm:checkin -Dmessage=\"Releasing version ${version}\" -DpushChanges=false" | ||
sh "$MAVEN_HOME/bin/mvn -B -V scm:tag -Dtag=${version}" | ||
} | ||
} | ||
|
||
stage('Next version') { | ||
when { | ||
expression { params.nextVersion != '' } | ||
} | ||
steps { | ||
sh "$MAVEN_HOME/bin/mvn -B -V versions:set -DnewVersion=${nextVersion} -DprocessAllModules=true" | ||
sh "$MAVEN_HOME/bin/mvn -B -V versions:set-property -Dproperty=version.infinispan -DnewVersion=${nextVersion}" | ||
sh "$MAVEN_HOME/bin/mvn -B -V -Dmessage='next version ${nextVersion}' -DscmVersion=${branch} -DscmVersionType=branch scm:checkin" | ||
} | ||
} | ||
} | ||
|
||
post { | ||
always { | ||
// Clean | ||
sh 'git clean -fdx -e "*.hprof" || echo "git clean failed, exit code $?"' | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters