modified: Jenkinsfile Bumped to 2.17.2 and removed some RUN commands to reduce image layers
30 lines
866 B
Groovy
30 lines
866 B
Groovy
node("docker-node") {
|
|
docker.withRegistry('https://harbor.ervine.dev', 'jenkins-to-harbor') {
|
|
|
|
git branch: "3.11.3", url: "ssh://git@git.ervine.org:2222/jonny/x86_64-alpine-nzbhydra", 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/nzbhydra2"
|
|
|
|
stage "publish"
|
|
app.push("${env.BUILD_NUMBER}")
|
|
app.push("2.17.2")
|
|
app.push("2")
|
|
app.push("latest")
|
|
|
|
stage('Deploy on K8s'){
|
|
sh "/usr/local/bin/kubectl -n media delete po nzbhydra-0"
|
|
}
|
|
}
|
|
catch (err) {
|
|
currentBuild.result = 'FAILURE'
|
|
}
|
|
}
|
|
}
|
|
|