ip/Jenkinsfile
Julien Cabillot cdb4186a6d
Some checks failed
Web/ip/pipeline/head There was a failure building this commit
web/ip/pipeline/head There was a failure building this commit
test pas sur du tout
2021-02-12 16:16:53 -05:00

47 lines
1.1 KiB
Groovy

pipeline {
environment {
registry = 'https://registry.hub.docker.com'
registryCredential = 'dockerhub_jcabillot'
dockerImage = 'jcabillot/ip:arm64'
}
//agent any
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{
container('jnlp') {
checkout scm
}
}
}
stage('Build image') {
steps{
sh 'docker build --build-arg VERSION=arm64 --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}'
}
}
}
}
}
}