Integration with Jenkins

Hi Team,

I am integrating K6 cloud to Jenkins pipeline. I am not a root user and not having sudo permission. So when i execute the k6 cloud i got below exception.

  • k6 login cloud --token xxx
    time=“2022-06-09T14:17:05Z” level=error msg=“mkdir /.config: permission denied”

Already running K6 container with default jenkins userid 1000. I saw we can change the path of config file. Can anybody help to resolve this issue?

Regards,
Amit

Hi @apal,
you can use as a better alternative the K6_CLOUD_TOKEN environment variable.

You should set the variable from Jenkins so the command will end in something like the following example:

$ K6_CLOUD_TOKEN=<YOUR_K6_CLOUD_API_TOKEN> k6 cloud script.js

Let me know if it helps.

Hi @codebien ,

I was able to resolve the issue with --config option. Thank you for responding.

Regards,
Amit