Skip to content

Commit

Permalink
add missing stages
Browse files Browse the repository at this point in the history
  • Loading branch information
skuzzle committed Dec 21, 2021
1 parent 6165857 commit bddfc80
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions JenkinsfileRelease
Original file line number Diff line number Diff line change
Expand Up @@ -18,56 +18,57 @@ pipeline {
GITHUB_RELEASE_TOKEN = credentials('github_registry_release')
GIT_ASKPASS='./.git-askpass'
}
stage ('Ensure dev branch') {
when {
expression {
return env.BRANCH_NAME != 'dev';
stages {
stage ('Ensure dev branch') {
when {
expression {
return env.BRANCH_NAME != 'dev';
}
}
steps {
error("Releasing is only possible from dev branch")
}
}
steps {
error("Releasing is only possible from dev branch")
}
}
stage ('Set Git Information') {
steps {
sh 'echo \'echo \$GITHUB_PSW\' > ./.git-askpass'
sh 'chmod +x ./.git-askpass'
sh 'git config url."https://api@github.com/".insteadOf "https://github.com/"'
sh 'git config url."https://ssh@github.com/".insteadOf "ssh://git@github.com/"'
sh 'git config url."https://git@github.com/".insteadOf "git@github.com:"'
sh 'git config user.email "build@taddiken.online"'
sh 'git config user.name "Jenkins"'
stage ('Set Git Information') {
steps {
sh 'echo \'echo \$GITHUB_PSW\' > ./.git-askpass'
sh 'chmod +x ./.git-askpass'
sh 'git config url."https://api@github.com/".insteadOf "https://github.com/"'
sh 'git config url."https://ssh@github.com/".insteadOf "ssh://git@github.com/"'
sh 'git config url."https://git@github.com/".insteadOf "git@github.com:"'
sh 'git config user.email "build@taddiken.online"'
sh 'git config user.name "Jenkins"'
}
}
}
stage('Create release branch') {
steps {
sh 'mvn -B -Prelease gitflow:release-start'
stage('Create release branch') {
steps {
sh 'mvn -B -Prelease gitflow:release-start'
}
}
}
stage('Build and push release') {
steps {
sh 'mvn -B -Prelease "-Ddocker.publish.usr=\${DOCKER_REGISTRY_USR}" "-Ddocker.publish.psw=\${DOCKER_REGISTRY_PSW}" -Dspring-boot.build-image.publish=true clean spring-boot:build-image'
stage('Build and push release') {
steps {
sh 'mvn -B -Prelease "-Ddocker.publish.usr=\${DOCKER_REGISTRY_USR}" "-Ddocker.publish.psw=\${DOCKER_REGISTRY_PSW}" -Dspring-boot.build-image.publish=true clean spring-boot:build-image'
}
}
}
stage('Update readme') {
steps {
sh 'git add README.md RELEASE_NOTES.md'
sh 'git commit -m "Update README and RELEASE_NOTES"'
stage('Update readme') {
steps {
sh 'git add README.md RELEASE_NOTES.md'
sh 'git commit -m "Update README and RELEASE_NOTES"'
}
}
}
stage('Merge release branch') {
steps {
sh "mvn -B gitflow:release-finish"
stage('Merge release branch') {
steps {
sh "mvn -B gitflow:release-finish"
}
}
}
stage('Create GitHub release') {
steps {
sh 'git checkout master'
sh "mvn -B github-release:github-release -Dgithub.release-token=${GITHUB_RELEASE_TOKEN}"
stage('Create GitHub release') {
steps {
sh 'git checkout master'
sh "mvn -B github-release:github-release -Dgithub.release-token=${GITHUB_RELEASE_TOKEN}"
}
}
}
}

stage('Deploy to production') {
agent any
environment {
Expand Down

0 comments on commit bddfc80

Please sign in to comment.