Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60231

Jenkins does not update Jenkinsfile when it was updated

      Hello Support team,

      I'm running jenkins 2.190.2 on a openshift cluster 3.10 and I'm recently experimenting Jenkins to deploy our applications into our openshift cluster. So, during my testing phases on Jenkins I have created a simple jenkinsfile and put it into a github repository. Then I configure Jenkins and SCM plugin to retrieve my Jenkinsfile but now, when I make some changes into the jenkinsfile and run a new job. Jenkins didn't try to pull the latest version of my jenkinsfile and still using the old one.

      Can you help me to understand why ?

      I make some research over internet and I tried a lot of things but I have the same problem. I have to delete manually my workspace (connect to jenkins container and rm -rf workspace folder).

      • I tried to install Workspace cleanup and Build Environment plugins but I don't show the option (checkbox) "Clear Workspace before running job" in the settings of my pipeline.
      • I tried to add a post step into my jenkinsfile to always call the function cleanWs() but same result old jenkinsfile is used.
      • I tried to configure manually Additional Behaviours in SCM configuration but it's not persisted because I'm using openshift-sync-plugin which override pipeline configuration.

       

      Here you can find my testing jenkinsfile

      pipeline {
        agent {
          kubernetes {
            cloud 'openshift-eu'
            label 'jnlp'
          }
        }
        stages {
          stage('Checkout code') {
            steps {
              git branch: "rbe-tests", 
              url: "https://github.com/thedigitalstudio/samquote-api-tests.git",
              credentialsId: "eb-cicd-eu-dev-axa-ebp-fr-jenkins-git-credentials"
            }
          }
          stage('Test A') { 
            steps {
              container('busybox') {
                sh "echo 'Hello world'"
                sh "echo 'sleep 3600'"
                sh "ls -la"
                sh "cat Jenkinsfile"
              }
            }
          }
        }
        post { 
          always { 
            cleanWs()
          }
        }
      } 

      Best regards,

      Thanks you

      Rayane.

          [JENKINS-60231] Jenkins does not update Jenkinsfile when it was updated

          Rayane BELLAZAAR created issue -
          Rayane BELLAZAAR made changes -
          Description Original: Hello Support team,

          I'm running jenkins 2.190.2 on a openshift cluster 3.10 and I'm recently experimenting Jenkins to deploy our applications into our openshift cluster. So, during my testing phases on Jenkins I have created a simple jenkinsfile and put it into a github repository. Then I configure Jenkins and SCM plugin to retrieve my Jenkinsfile but now, when I make some changes into the jenkinsfile and run a new job. Jenkins didn't try to pull the latest version of my jenkinsfile and still using the old one.

          Can you help me to understand why ?

          I make some research over internet and I tried a lot of things but I have the same problem. I have to delete manually my workspace _(connect to jenkins container and rm -rf workspace folder)._
           * I tried to install *Workspace cleanup* and *Build Environment* plugins but I don't show the option _(checkbox)_ "Clear Workspace before running job" in the settings of my pipeline.
           * I tried to add a _*post*_ step into my jenkinsfile to always call the function *cleanWs()* but same result old jenkinsfile is used.
           * I tried to configure manually _*Additional Behaviours*_ in SCM configuration but it's not persisted because I'm using openshift-sync-plugin which override pipeline configuration.

           

          Best regards,

          Thanks you

          Rayane.
          New: Hello Support team,

          I'm running jenkins 2.190.2 on a openshift cluster 3.10 and I'm recently experimenting Jenkins to deploy our applications into our openshift cluster. So, during my testing phases on Jenkins I have created a simple jenkinsfile and put it into a github repository. Then I configure Jenkins and SCM plugin to retrieve my Jenkinsfile but now, when I make some changes into the jenkinsfile and run a new job. Jenkins didn't try to pull the latest version of my jenkinsfile and still using the old one.

          Can you help me to understand why ?

          I make some research over internet and I tried a lot of things but I have the same problem. I have to delete manually my workspace _(connect to jenkins container and rm -rf workspace folder)._
           * I tried to install *Workspace cleanup* and *Build Environment* plugins but I don't show the option _(checkbox)_ "Clear Workspace before running job" in the settings of my pipeline.
           * I tried to add a _*post*_ step into my jenkinsfile to always call the function *cleanWs()* but same result old jenkinsfile is used.
           * I tried to configure manually _*Additional Behaviours*_ in SCM configuration but it's not persisted because I'm using openshift-sync-plugin which override pipeline configuration.

           
          {code:java}
          pipeline { agent { kubernetes { cloud 'openshift-eu' label 'jnlp' } } stages { stage('Checkout code') { steps { git branch: "rbe-tests", url: "https://github.com/thedigitalstudio/samquote-api-tests.git", credentialsId: "eb-cicd-eu-dev-axa-ebp-fr-jenkins-git-credentials" } } stage('Test A') { steps { container('busybox') { sh "echo 'Hello world'" sh "echo 'sleep 3600'" sh "ls -la" sh "cat Jenkinsfile" } } } } post { always { cleanWs() } } }
          {code}
           

          Best regards,

          Thanks you

          Rayane.
          Rayane BELLAZAAR made changes -
          Description Original: Hello Support team,

          I'm running jenkins 2.190.2 on a openshift cluster 3.10 and I'm recently experimenting Jenkins to deploy our applications into our openshift cluster. So, during my testing phases on Jenkins I have created a simple jenkinsfile and put it into a github repository. Then I configure Jenkins and SCM plugin to retrieve my Jenkinsfile but now, when I make some changes into the jenkinsfile and run a new job. Jenkins didn't try to pull the latest version of my jenkinsfile and still using the old one.

          Can you help me to understand why ?

          I make some research over internet and I tried a lot of things but I have the same problem. I have to delete manually my workspace _(connect to jenkins container and rm -rf workspace folder)._
           * I tried to install *Workspace cleanup* and *Build Environment* plugins but I don't show the option _(checkbox)_ "Clear Workspace before running job" in the settings of my pipeline.
           * I tried to add a _*post*_ step into my jenkinsfile to always call the function *cleanWs()* but same result old jenkinsfile is used.
           * I tried to configure manually _*Additional Behaviours*_ in SCM configuration but it's not persisted because I'm using openshift-sync-plugin which override pipeline configuration.

           
          {code:java}
          pipeline { agent { kubernetes { cloud 'openshift-eu' label 'jnlp' } } stages { stage('Checkout code') { steps { git branch: "rbe-tests", url: "https://github.com/thedigitalstudio/samquote-api-tests.git", credentialsId: "eb-cicd-eu-dev-axa-ebp-fr-jenkins-git-credentials" } } stage('Test A') { steps { container('busybox') { sh "echo 'Hello world'" sh "echo 'sleep 3600'" sh "ls -la" sh "cat Jenkinsfile" } } } } post { always { cleanWs() } } }
          {code}
           

          Best regards,

          Thanks you

          Rayane.
          New: Hello Support team,

          I'm running jenkins 2.190.2 on a openshift cluster 3.10 and I'm recently experimenting Jenkins to deploy our applications into our openshift cluster. So, during my testing phases on Jenkins I have created a simple jenkinsfile and put it into a github repository. Then I configure Jenkins and SCM plugin to retrieve my Jenkinsfile but now, when I make some changes into the jenkinsfile and run a new job. Jenkins didn't try to pull the latest version of my jenkinsfile and still using the old one.

          Can you help me to understand why ?

          I make some research over internet and I tried a lot of things but I have the same problem. I have to delete manually my workspace _(connect to jenkins container and rm -rf workspace folder)._
           * I tried to install *Workspace cleanup* and *Build Environment* plugins but I don't show the option _(checkbox)_ "Clear Workspace before running job" in the settings of my pipeline.
           * I tried to add a _*post*_ step into my jenkinsfile to always call the function *cleanWs()* but same result old jenkinsfile is used.
           * I tried to configure manually _*Additional Behaviours*_ in SCM configuration but it's not persisted because I'm using openshift-sync-plugin which override pipeline configuration.

           

          Here you can find my testing jenkinsfile
          {code:java}
          pipeline {
            agent {
              kubernetes {
                cloud 'openshift-eu'
                label 'jnlp'
              }
            }
            stages {
              stage('Checkout code') {
                steps {
                  git branch: "rbe-tests",
                  url: "https://github.com/thedigitalstudio/samquote-api-tests.git",
                  credentialsId: "eb-cicd-eu-dev-axa-ebp-fr-jenkins-git-credentials"
                }
              }
              stage('Test A') {
                steps {
                  container('busybox') {
                    sh "echo 'Hello world'"
                    sh "echo 'sleep 3600'"
                    sh "ls -la"
                    sh "cat Jenkinsfile"
                  }
                }
              }
            }
            post {
              always {
                cleanWs()
              }
            }
          } {code}
          Best regards,

          Thanks you

          Rayane.
          Rayane BELLAZAAR made changes -
          Component/s New: kubernetes-plugin [ 20639 ]
          Component/s New: openshift-sync-plugin [ 21623 ]
          Vincent Latombe made changes -
          Component/s Original: kubernetes-plugin [ 20639 ]

          It happened to me once in a while and I fixed it by terminating Jenkins controller pod. After it was recreated, Jenkinsfile was updated.

          Valeriy Zabawski added a comment - It happened to me once in a while and I fixed it by terminating Jenkins controller pod. After it was recreated, Jenkinsfile was updated.

            Unassigned Unassigned
            rayanebel Rayane BELLAZAAR
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: