modified: Jenkinsfile
Added code to auto-deploy to k8s
This commit is contained in:
parent
5414f92732
commit
c12a5472ea
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@ -7,11 +7,21 @@ node("docker-node") {
|
|||||||
def commit_id = readFile('.git/commit-id').trim()
|
def commit_id = readFile('.git/commit-id').trim()
|
||||||
println commit_id
|
println commit_id
|
||||||
|
|
||||||
stage "build"
|
try {
|
||||||
def app = docker.build "library/x86_64/alpine/transmission"
|
stage "build"
|
||||||
|
def app = docker.build "library/x86_64/alpine/transmission"
|
||||||
|
|
||||||
|
stage "publish"
|
||||||
|
app.push("${env.BUILD_NUMBER}")
|
||||||
|
app.push("latest")
|
||||||
|
|
||||||
|
stage('Deploy on K8s'){
|
||||||
|
sh "/usr/local/bin/kubectl -n media delete po transmission-0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
currentBuild.result = 'FAILURE'
|
||||||
|
}
|
||||||
|
|
||||||
stage "publish"
|
|
||||||
app.push("${env.BUILD_NUMBER}")
|
|
||||||
app.push("latest")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user