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

Environment variables not explanded for "Remote Directory" configuration

      I'm using publish over ssh to send file on a remote folder
      and Exec commands.

      As the folder where I put the files may change in the future I defined a
      Jenkins environment variable: REMOTE_LOCATION.

      I'd like to use this variable in SSH publish over configuration and in the
      Exec command of the job.

      I configured ssh publish over plugin with Remote Directory set to ${REMOTE_LOCATION}

      I get this error :

      ERROR: Exception when publishing, exception message [Failed to change to remote directory [${REMOTE_LOCATION}]]
      Build step 'Send build artifacts over SSH' changed build result to UNSTABLE

      I checked that the variable is set properly by echo ${REMOTE_LOCATION} in the Exec command.

      Variables should be expanded in the "Remote Directory" configuration field.

          [JENKINS-13460] Environment variables not explanded for "Remote Directory" configuration

          bap added a comment -

          The Remote directory configured in the global configuration (Manage Jenkins) does not support variable substitution.

          The Remote directory in a job configuration does.

          You should be able to set the global Remote directory to / and then use the variable in the job configuration (where Exec command is configured)

          bap added a comment - The Remote directory configured in the global configuration (Manage Jenkins) does not support variable substitution. The Remote directory in a job configuration does. You should be able to set the global Remote directory to / and then use the variable in the job configuration (where Exec command is configured)

          Yes this is working, but having a folder in the global configuration
          restricts were the files are sent, and avoid sending file anywhere
          in case of bad job configuration.

          Bertrand Latinville added a comment - Yes this is working, but having a folder in the global configuration restricts were the files are sent, and avoid sending file anywhere in case of bad job configuration.

          bap added a comment -

          If you use a vaiable in the global config, I can then set that variable to anything I want in the job configuration.
          This exactly what you are trying to avoid!

          bap added a comment - If you use a vaiable in the global config, I can then set that variable to anything I want in the job configuration. This exactly what you are trying to avoid!

          For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues

          Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/221
          And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-13460%22

          (Note: this is an automated bulk comment)

          Gavin McDonald added a comment - For your information, all publish-over-ssh component type JENKINS issues related to the Publish Over SSH plugin have been transferred to Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues Here is the direct link to this issue in Github: https://github.com/jenkinsci/publish-over-ssh-plugin/issues/221 And here is the link to a search for related issues: https://github.com/jenkinsci/publish-over-ssh-plugin/issues?q=%22JENKINS-13460%22 (Note: this is an automated bulk comment)

            bap bap
            blatinville Bertrand Latinville
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: