mirror of
https://github.com/iFargle/headscale-webui.git
synced 2026-03-18 15:35:30 +01:00
51 lines
1.5 KiB
Groovy
51 lines
1.5 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("albert/headscale-webui:${env.BRANCH_NAME}-${env.BUILD_ID}",
|
|
"--label \"GIT_COMMIT=${env.GIT_COMMIT}\""
|
|
+ " ."
|
|
)
|
|
}
|
|
}
|
|
}
|
|
stage('Test') {
|
|
options { timeout(time: 3, unit: 'MINUTES') }
|
|
steps {
|
|
script {
|
|
docker.image("albert/headscale-webui:${env.BRANCH_NAME}-${env.BUILD_ID}").inside {
|
|
sh 'hostname'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
stage('Push') {
|
|
options { timeout(time: 5, unit: 'MINUTES') }
|
|
steps {
|
|
script {
|
|
docker.withRegistry('https://git.sysctl.io/', 'gitea-jenkins-pat') {
|
|
dockerImage.push("${env.BRANCH_NAME}-${env.BUILD_ID}")
|
|
}
|
|
}
|
|
milestone 30
|
|
}
|
|
}
|
|
}
|
|
} |