#5179 Escape $ to fix Jenkins interpolation warning (#5178)
Merged 2 years ago by ngompa. Opened 2 years ago by abitrolly.
abitrolly/pagure master  into  master

file modified
+1 -1
@@ -9,7 +9,7 @@ 

            wait for jenkins to be done, so if we wait for pagure's answer we're

            basically stuck in a loop where both jenkins and pagure are waiting

            for each other */

-         sh "timeout 1 curl -X POST -d \'$json\' https://pagure.io/api/0/ci/jenkins/$repo/${PAGURE_PUSH_SECRET}/build-finished -H \"Content-Type: application/json\" | true"

+         sh "timeout 1 curl -X POST -d \'$json\' https://pagure.io/api/0/ci/jenkins/$repo/\${PAGURE_PUSH_SECRET}/build-finished -H \"Content-Type: application/json\" | true"

      }

  }

  

Escaping $ in "" string makes the variable expanded by shell, and not Jenkins itself

Explained in example in official docs
https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#for-other-credential-types

rebased onto 122eea5

2 years ago

I still see the warning in the CI build https://ci.centos.org/job/pagure-pr/4102/ and I suppose the changes to Jenkinsfile in the PR are not picked up by Jenkins until they are merged into master.

At least this is what the log shows.

Started by remote host 8.43.85.76 with note: 5179
Obtained .cico.pipeline from git https://pagure.io/pagure.git
...

Pull-Request has been merged by ngompa

2 years ago
Metadata