-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes in pom for release preparation
+ Added Jenkinsfile for release pipeline(Just for reference) + Moved individual profiles into parent pom
- Loading branch information
1 parent
886826f
commit 084ebeb
Showing
8 changed files
with
309 additions
and
483 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,65 @@ | ||
#!groovy | ||
|
||
pipeline { | ||
agent any | ||
tools { | ||
maven 'apache-maven-latest' | ||
jdk 'adoptopenjdk-hotspot-jdk8-latest' | ||
} | ||
stages { | ||
stage('Build') { | ||
steps { | ||
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) { | ||
sh 'gpg --batch --import "${KEYRING}"' | ||
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done' | ||
} | ||
withCredentials([string(credentialsId: '00d22e13-04f3-432a-b95b-90893e93e70b', variable: 'GH_TOKEN')]) { | ||
} | ||
sh ''' | ||
# Setup Git Config | ||
git config --global user.email eclipsejkubebot@eclipse.org | ||
git config --global user.name "Eclipse Jkube Bot" | ||
git clone https://eclipse-jkube-bot:$GH_TOKEN@github.com/eclipse/jkube.git && cd jkube | ||
# Find Project release version | ||
HEAD=$(git log -1 --format=format:%H) | ||
PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) | ||
NEXT_RELEASE_VERSION=`echo $PROJECT_VERSION | sed 's/-SNAPSHOT//g'` | ||
if [ ${#NEXT_RELEASE_VERSION} -eq 3 ]; then | ||
NEXT_RELEASE_VERSION=`echo "$NEXT_RELEASE_VERSION.0"` | ||
fi | ||
echo "Releasing project with version $NEXT_RELEASE_VERSION" | ||
# Prepare project for release, modify pom to new release version | ||
mvn versions:set -DnewVersion=$NEXT_RELEASE_VERSION | ||
find . -iname *.versionsBackup -exec rm {} + | ||
git add . && git commit -m "[RELEASE] Modified Project pom version to $NEXT_RELEASE_VERSION" | ||
git tag $NEXT_RELEASE_VERSION | ||
git push origin $NEXT_RELEASE_VERSION | ||
git push origin master | ||
mvn clean -B | ||
mvn -V -B -e -U install org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy -P release -DnexusUrl=https://oss.sonatype.org -DserverId=ossrh | ||
# Modify poms back to SNAPSHOT VERSIONS | ||
MAJOR_VERSION=`echo $NEXT_RELEASE_VERSION | cut -d. -f1` | ||
MINOR_VERSION=`echo $NEXT_RELEASE_VERSION | cut -d. -f2` | ||
PATCH_VERSION=`echo $NEXT_RELEASE_VERSION | cut -d. -f3` | ||
PATCH_VERSION=$(($PATCH_VERSION + 1)) | ||
NEXT_SNAPSHOT_VERSION=`echo "$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION-SNAPSHOT"` | ||
mvn versions:set -DnewVersion=$NEXT_SNAPSHOT_VERSION | ||
find . -iname *.versionsBackup -exec rm {} + | ||
git add . && git commit -m "[RELEASE] Prepare project for next development iteration $NEXT_SNAPSHOT_VERSION" | ||
git push origin master | ||
# read repo_id from *.properties file and set it | ||
repo_id=$(cat target/nexus-staging/staging/*.properties | grep id | awk -F'=' '{print $2}') | ||
mvn -B org.sonatype.plugins:nexus-staging-maven-plugin:1.6.5:rc-release -DserverId=ossrh -DnexusUrl=https://oss.sonatype.org -DstagingRepositoryId=${repo_id} -Ddescription=\"Next release is ready\" -DstagingProgressTimeoutMinutes=60 | ||
''' | ||
} | ||
} | ||
} | ||
} | ||
|
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
Oops, something went wrong.