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

readFileFromWorkspace doesn't not update the shell step if the referenced file content has changed

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      readFileFromWorkspace doesn't not update the shell step if the referenced file content has changed. I have checked that Action for existing jobs and views -> Ignore changes box is NOT ticked.
      Exemple:

      step {
           shell(readFileFromWorkspace("/apps/tools/scripts/myscript.sh"))
      }
      

      myscript.sh content:

      #!/bin/bash
      echo Hello world!
      

      The first time I build, the jobs are created correctly with the matching shell step content:

      #!/bin/bash
      echo Hello world!
      

      If I change the script myscript.sh:

      #!/bin/bash
      echo Hello guys!
      

      I build again I still get the previous content in the step:

      #!/bin/bash
      echo Hello world!
      

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          I can't reproduce this with this script:

          job('example') {
            steps {
               shell(readFileFromWorkspace("/tmp/myscript.sh"))
            }
          }
          

          Your example seems to have a typo, it's steps and not step.

          Note that the file will be read on the node which is running the seed job, which may or may not be the master node. Did you update the file on the correct node?

          Show
          daspilker Daniel Spilker added a comment - I can't reproduce this with this script: job( 'example' ) { steps { shell(readFileFromWorkspace( "/tmp/myscript.sh" )) } } Your example seems to have a typo, it's steps and not step . Note that the file will be read on the node which is running the seed job, which may or may not be the master node. Did you update the file on the correct node?

            People

            Assignee:
            daspilker Daniel Spilker
            Reporter:
            lautou Laurent TOURREAU
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: