2018-07-02 13:27:39 +00:00
|
|
|
properties([disableConcurrentBuilds()])
|
|
|
|
|
2018-06-28 12:56:54 +00:00
|
|
|
node('linux') {
|
2018-07-02 13:27:39 +00:00
|
|
|
|
2018-06-28 12:56:54 +00:00
|
|
|
def image_name = 'statusteam/universal-links-handler'
|
|
|
|
def commit
|
|
|
|
def image
|
|
|
|
|
|
|
|
stage('Git Prep') {
|
|
|
|
checkout scm
|
|
|
|
commit = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
image = docker.build(image_name + ':' + commit)
|
|
|
|
}
|
|
|
|
|
2018-07-02 13:27:39 +00:00
|
|
|
stage('Tests') {
|
|
|
|
image.withRun('-p 8080:80 -e PORT=80') { c ->
|
|
|
|
sh 'tests/run.sh -u 127.0.0.1:8080'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-28 12:56:54 +00:00
|
|
|
stage('Publish') {
|
|
|
|
withDockerRegistry([
|
|
|
|
credentialsId: "dockerhub-statusteam-auto", url: ""
|
|
|
|
]) {
|
|
|
|
image.push()
|
2018-06-29 07:50:31 +00:00
|
|
|
image.push('deploy')
|
2018-06-28 12:56:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|