Gestion download au travers de premiumizeme
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

2 weeks ago
2 weeks ago
  1. pipeline {
  2. environment {
  3. registry = 'https://registry.hub.docker.com'
  4. registryCredential = 'dockerhub_jcabillot'
  5. dockerImage = 'jcabillot/mydl:arm64'
  6. }
  7. //agent { label 'arm64' }
  8. agent {
  9. kubernetes {
  10. defaultContainer 'docker' // All `steps` instructions will be executed by this container
  11. yamlFile 'Jenkinsfile-pod-template.yml'
  12. }
  13. }
  14. triggers {
  15. cron('@midnight')
  16. }
  17. stages {
  18. stage('Clone repository') {
  19. steps{
  20. checkout scm
  21. }
  22. }
  23. stage('Build image') {
  24. steps{
  25. sh 'docker build --build-arg VERSION=arm64 --force-rm=true --no-cache=true --pull -t ${dockerImage} .'
  26. }
  27. }
  28. stage('Deploy Image') {
  29. steps{
  30. script {
  31. withCredentials([usernamePassword(credentialsId: 'dockerhub_jcabillot', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
  32. sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}'
  33. sh 'docker push ${dockerImage}'
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }