Files
tv7playlist/Jenkinsfile
Philipp Haefelfinger 548ff437c1
All checks were successful
tv7playlist/pipeline/head This commit looks good
reconfigured to rebuild all branches once a wekk
2021-03-07 20:46:02 +01:00

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"
}
}
}
}