27 lines
789 B
Groovy
27 lines
789 B
Groovy
node("docker-node") {
|
|
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
|
|
|
git branch: "v3-dev", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-alpine-sonarr", 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/sonarr"
|
|
|
|
stage "publish"
|
|
app.push("v3.0.3.748")
|
|
app.push("v3")
|
|
|
|
stage('Deploy on K8s'){
|
|
sh "/usr/local/bin/kubectl -n media delete po sonarr3-0"
|
|
}
|
|
}
|
|
catch (err) {
|
|
currentBuild.result = 'FAILURE'
|
|
}
|
|
}
|
|
}
|