Permet simplement d'afficher l'IP du visiteur
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.

38 lines
824 B

  1. pipeline {
  2. environment {
  3. registry = 'https://registry.hub.docker.com'
  4. registryCredential = 'dockerhub_jcabillot'
  5. dockerImage = 'jcabillot/ip'
  6. }
  7. agent any
  8. triggers {
  9. cron('@midnight')
  10. }
  11. stages {
  12. stage('Clone repository') {
  13. steps{
  14. checkout scm
  15. }
  16. }
  17. stage('Build image') {
  18. steps{
  19. sh 'docker build --force-rm=true --no-cache=true --pull -t ${dockerImage} .'
  20. }
  21. }
  22. stage('Deploy Image') {
  23. steps{
  24. script {
  25. withCredentials([usernamePassword(credentialsId: 'dockerhub_jcabillot', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) {
  26. sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}'
  27. sh 'docker push ${dockerImage}'
  28. }
  29. }
  30. }
  31. }
  32. }
  33. }