Running docker run --rm -i run -o cloud in jenkins

Hi, nice framework

i have a requirement to run k6 docker cloud but in jenkins
i’ve already tried this syntax

docker run --rm -i \
          -e K6_CLOUD_TOKEN=${K6_CLOUD_TOKEN} -e K6_CLOUD_PROJECT_ID=${K6_CLOUD_PROJECT_ID} \
          grafana/k6 run -o cloud - <./loadtests/scenarios/backend/GET/${ENDPOINT} \
          -e BASE_API=https://qeomid-demo.wiremockapi.cloud -e BASE_CDS=https://qeomid-demo.wiremockapi.cloud \
          -e PASSWORD_REGON=${PASSWORD_REGON} -e PASSWORD_SUBER=${PASSWORD_SUBER}

but it become this automatically in jenkins

docker run --rm -i -e K6_CLOUD_TOKEN=<token value> -e K6_CLOUD_PROJECT_ID=<project ID value> grafana/k6 run -o cloud - (**MISSING HERE**) -e BASE_API=https://qeomid-demo.wiremockapi.cloud -e BASE_CDS=https://qeomid-demo.wiremockapi.cloud -e PASSWORD_REGON=<pword value> -e PASSWORD_SUBER=<pword value>

but somehow the character < is not readable in jenkins, do you know what is the correct syntax for the k6. command?

thanks so much

Hi @mpermperpisangqeomid

Welcome to the community forums! :wave:

I’m not so familiar with Jenkins, but have you tried to escape the special character with a backslash \?

The important thing here is that you’re not limited to that execution. In a simplified example:

docker run --rm -i grafana/k6 run - <script.js

The - <script.js is just redirect a content of the script.js file to the k6.

But you can try mounting the catalog with the scripts as the docker volume and then use “local” path for docker containers. For example, there was an answer to that topic Modularize structure not running on docker - #7 by olegbespalov

Cheers!