All checks were successful
tv7playlist/pipeline/head This commit looks good
53 lines
1001 B
Groovy
53 lines
1001 B
Groovy
// Rebuild the container of all branches every wednesday
|
|
CRON_SETTINGS = '''H H * * 3'''
|
|
|
|
pipeline {
|
|
environment {
|
|
imagename = "phaefelfinger/tv7playlist"
|
|
registryCredential = 'phdockerhub'
|
|
dockerImage = ''
|
|
}
|
|
|
|
agent { node { label 'docker' } }
|
|
|
|
triggers {
|
|
cron(CRON_SETTINGS)
|
|
}
|
|
|
|
stages {
|
|
stage('Cloning repository') {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
|
|
stage('Building image') {
|
|
steps{
|
|
script {
|
|
dockerImage = docker.build imagename
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Publishing image') {
|
|
steps{
|
|
script {
|
|
docker.withRegistry( '', registryCredential ) {
|
|
dockerImage.push('latest')
|
|
dockerImage.push('3.1')
|
|
dockerImage.push('3.1.0')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Remove unused docker image') {
|
|
steps{
|
|
sh "docker rmi $imagename:latest"
|
|
sh "docker rmi $imagename:3.1"
|
|
sh "docker rmi $imagename:3.1.0"
|
|
}
|
|
}
|
|
}
|
|
}
|