Luis Nuño
08/28/2024, 9:34 PMpublishPacts(opts) function from Jenkins, but it fails with next error:
13:01:19 Error publishing pacts: Error: Pact publication failed with non-zero exit code. Full output was:
13:01:19 /home/jenkins/agent/workspace/<my_repo>/node_modules/@pact-foundation/pact-node/standalone/linux-x64-2.4.1/pact/lib/ruby/bin/ruby: 6: eval: -: not found
13:01:19
13:01:19 at ChildProcess.<anonymous> (/home/jenkins/agent/workspace/<my_repo>/node_modules/@pact-foundation/pact-node/src/publisher.js:79:40)
13:01:19 at Object.onceWrapper (node:events:634:26)
13:01:19 at ChildProcess.emit (node:events:531:35)
13:01:19 at maybeClose (node:internal/child_process:1105:16)
13:01:19 at Socket.<anonymous> (node:internal/child_process:457:11)
13:01:19 at Socket.emit (node:events:519:28)
13:01:19 at Pipe.<anonymous> (node:net:339:12)
13:01:19 [14:01:19.523] INFO (698): pact-node@10.18.0: Publishing Pacts to Broker
13:01:19 [14:01:19.524] INFO (698): pact-node@10.18.0: Publishing pacts to broker at: https://<my_domain>.<http://pactflow.io/|pactflow.io/>
13:01:19 [14:01:19.536] WARN (698): pact-node@10.18.0: Pact exited with code 127.
13:01:19 [14:01:19.536] ERROR (698): pact-node@10.18.0: Pact publication failed with non-zero exit code. Full output was:
13:01:19 /home/jenkins/agent/workspace/<my_repo>/node_modules/@pact-foundation/pact-node/standalone/linux-x64-2.4.1/pact/lib/ruby/bin/ruby: 6: eval: -: not found
When I run it from my local machine it works fine and with no issues, but when I try to run it from a Debian Docker container in Jenkins I get the above error.
I guess there may be some additional dependencies that my linux container is missing.
Is there any list of all the requirements and dependencies needed to run the publishPacts() function with no errors?Matt (pactflow.io / pact-js / pact-go)
eval , or eval is executing and it’s not happen with some argumentMatt (pactflow.io / pact-js / pact-go)
<my repo> has a - in it.
The contents of the ruby “binary” is thus:
#!/bin/bash
set -e
ROOT=`dirname "$0"`
ROOT=`cd "$ROOT/.." && pwd`
eval "`\"$ROOT/bin/ruby_environment\"`"
exec "$ROOT/bin.real/ruby" "$@"
/opt/pact/lib/ruby/bin/ruby
I suspect eval isn’t happy with that?Luis Nuño
08/28/2024, 11:00 PM- in <my_repo>, which is the Job name in JenkinsLuis Nuño
08/28/2024, 11:02 PMmy-github-repo - PRB - Contract TestLuis Nuño
08/28/2024, 11:03 PM- and try againLuis Nuño
08/28/2024, 11:04 PMLuis Nuño
08/28/2024, 11:11 PMLuis Nuño
08/28/2024, 11:11 PMMatt (pactflow.io / pact-js / pact-go)
ruby file (which is just a bash or sh script) to work with spaces, we could look to add a PR to https://phusion.github.io/traveling-ruby/ which is the tool we use to package up the CLI