syncthing-arm/Jenkinsfile
Julien Cabillot 754bcecde6
Some checks failed
perso/syncthing-arm/pipeline/head There was a failure building this commit
use k3s
2021-01-04 16:26:11 -05:00

45 lines
1.0 KiB
Groovy

pipeline {
environment {
registry = 'https://registry.hub.docker.com'
registryCredential = 'dockerhub_jcabillot'
dockerImage = 'jcabillot/syncthing-arm64'
}
//agent { label 'arm64' }
agent {
kubernetes {
defaultContainer 'docker' // All `steps` instructions will be executed by this container
yamlFile 'Jenkinsfile-pod-template.yml'
}
}
triggers {
cron('@midnight')
}
stages {
stage('Clone repository') {
steps{
checkout scm
}
}
stage('Build image') {
steps{
sh 'docker build --force-rm=true --no-cache=true --pull -t ${dockerImage} .'
}
}
stage('Deploy Image') {
steps{
script {
withCredentials([usernamePassword(credentialsId: 'dockerhub_jcabillot', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}'
sh 'docker push ${dockerImage}'
}
}
}
}
}
}