28 lines
839 B
Groovy
28 lines
839 B
Groovy
node("docker-node") {
|
|
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
|
|
|
git branch: "master", url: "ssh://git@git.ervine.org/jonny/x86_64-debian-bedrock", 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/debian/bedrock"
|
|
|
|
stage "publish"
|
|
app.push("${env.BUILD_NUMBER}")
|
|
app.push("1.16.02")
|
|
app.push("latest")
|
|
|
|
stage('Deploy on K8s'){
|
|
sh "/usr/local/bin/kubectl -n games delete po bedrock-0"
|
|
}
|
|
}
|
|
catch (err) {
|
|
currentBuild.result = 'FAILURE'
|
|
}
|
|
}
|
|
}
|