-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
204 additions
and
34 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
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,75 @@ | ||
pipeline { | ||
agent { | ||
docker { | ||
image 'maven:3.8.3-openjdk-17' | ||
args '-u 1000:999 -v /home/jenkins/.m2:/var/maven/.m2 -v /home/jenkins/.gnupg:/.gnupg -v /var/run/docker.sock:/var/run/docker.sock:ro -e MAVEN_CONFIG=/var/maven/.m2 -e MAVEN_OPTS=-Duser.home=/var/maven' | ||
} | ||
} | ||
environment { | ||
GITHUB = credentials('Github-Username-Pw') | ||
DOCKER_REGISTRY = credentials('github_docker_registry') | ||
GITHUB_RELEASE_TOKEN = credentials('github_registry_release') | ||
GIT_ASKPASS='./.git-askpass' | ||
VERSION = 'latest' | ||
} | ||
stages { | ||
stage ('Ensure dev branch') { | ||
when { | ||
expression { | ||
return env.BRANCH_NAME != 'dev'; | ||
} | ||
} | ||
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('Create release branch') { | ||
steps { | ||
sh 'mvn -B -Prelease gitflow:release-start' | ||
} | ||
} | ||
stage('Verify 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('Perform release') { | ||
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('Deploy to production') { | ||
agent any | ||
when { | ||
branch 'master' | ||
} | ||
steps { | ||
sh 'docker login -u ${DOCKER_REGISTRY_USR} -p ${DOCKER_REGISTRY_PSW} ghcr.io' | ||
sh 'docker stack deploy --compose-file swarm-stack/production.yml --prune --with-registry-auth gh-prom-exporter' | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,13 @@ | ||
<!-- This file is auto generated during release from readme/README.md --> | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/skuzzle/gh-prom-exporter/badge.svg?branch=master)](https://coveralls.io/github/skuzzle/gh-prom-exporter?branch=master) | ||
[![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS) | ||
|
||
|
||
# gh-prom-exporter | ||
|
||
Export your favorite GitHub repositories to Prometheus | ||
|
||
Stay tuned, detailed documentation follows... | ||
Use it _as a service_: https://gh.skuzzle.de | ||
|
||
Stay tuned, detailed documentation for on-premise use follows... |
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,10 @@ | ||
<!-- This file is auto generated during release from readme/RELEASE_NOTES.md --> | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/skuzzle/gh-prom-exporter/badge.svg?branch=master)](https://coveralls.io/github/skuzzle/gh-prom-exporter?branch=master) | ||
[![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS) | ||
|
||
* Test Release | ||
|
||
``` | ||
docker pull ghcr.io/skuzzle/gh-prom-exporter/gh-prom-exporter:0.0.1 | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- This file is auto generated during release from readme/README.md --> | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/${github.user}/${github.name}/badge.svg?branch=${github.main-branch})](https://coveralls.io/github/${github.user}/${github.name}?branch=${github.main-branch}) | ||
[![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS) | ||
|
||
|
||
# gh-prom-exporter | ||
|
||
Export your favorite GitHub repositories to Prometheus | ||
|
||
Use it _as a service_: https://gh.skuzzle.de | ||
|
||
Stay tuned, detailed documentation for on-premise use follows... |
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,10 @@ | ||
<!-- This file is auto generated during release from readme/RELEASE_NOTES.md --> | ||
|
||
[![Coverage Status](https://coveralls.io/repos/github/${github.user}/${github.name}/badge.svg?branch=${github.main-branch})](https://coveralls.io/github/${github.user}/${github.name}?branch=${github.main-branch}) | ||
[![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS) | ||
|
||
* Test Release | ||
|
||
``` | ||
docker pull ${spring-boot.build-image.imageName}:${project.version} | ||
``` |