mirror of
https://github.com/iFargle/headscale-webui.git
synced 2026-03-18 23:25:28 +01:00
45 lines
1.3 KiB
Groovy
45 lines
1.3 KiB
Groovy
def dockerImage
|
|
//jenkins needs entrypoint of the image to be empty
|
|
def runArgs = '--entrypoint \'\''
|
|
pipeline {
|
|
agent {
|
|
label 'linux-x64'
|
|
}
|
|
options {
|
|
buildDiscarder(logRotator(numToKeepStr: '100', artifactNumToKeepStr: '20'))
|
|
timestamps()
|
|
}
|
|
stages {
|
|
stage ('Environment') {
|
|
steps {
|
|
sh 'printenv'
|
|
}
|
|
}
|
|
stage('Build') {
|
|
options { timeout(time: 30, unit: 'MINUTES') }
|
|
steps {
|
|
script {
|
|
dockerImage = docker.build(":${env.BUILD_ID}",
|
|
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\""
|
|
+ " --build-arg MY_ARG=myArg"
|
|
+ " ."
|
|
)
|
|
}
|
|
}
|
|
}
|
|
stage('Push to docker repository') {
|
|
when { branch 'master' }
|
|
options { timeout(time: 5, unit: 'MINUTES') }
|
|
steps {
|
|
lock("${JOB_NAME}-Push") {
|
|
script {
|
|
docker.withRegistry('https://myrepo:5000', 'docker_registry') {
|
|
dockerImage.push('latest')
|
|
}
|
|
}
|
|
milestone 30
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |