x86_64-alpine-hockey/Jenkinsfile
Jonathan Ervine 40387b221b new file: Dockerfile
new file:   Jenkinsfile
	new file:   requirements.txt
2020-07-09 22:44:57 +08:00

27 lines
799 B
Groovy

node("docker-node") {
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
git branch: "3.11.6", url: "ssh://git@git.ervine.org/jonny/x86_64-alpine-hockey", credentialsId: 'jenkins-to-git'
sh "git rev-parse HEAD > .git/commit-id"
def commit_id = readFile('.git/commit-id').trim()
println commit_id
try {
stage "build"
def app = docker.build "library/x86_64/alpine/hockey"
stage "publish"
app.push("${env.BUILD_NUMBER}")
app.push("latest")
stage('Deploy on K8s'){
sh "/usr/local/bin/kubectl -n dev delete po --all"
}
}
catch (err) {
currentBuild.result = 'FAILURE'
}
}
}