watson / ci-info

Get details about the current Continuous Integration environment
MIT License
319 stars 49 forks source link

Support for concourse #52

Open oliveti opened 6 years ago

oliveti commented 6 years ago

Hi,

IT seems this library does not detect concourse ci : https://concourse-ci.org

Would be great if you could support it.

Thank you.

watson commented 6 years ago

@oliveti looking through their documentation I think maybe we can check for the CONCOURSE_EXTERNAL_URL environment variable. But I'm not a 100% sure. Do you have any experience in which envs are always present?

oliveti commented 6 years ago

This environment variable is not available in tasks (where we can run scripts) for design reasons. Here is the list of environment variables accessible.

USER=xxx PWD=/tmp/build/b504838c/source HOME=xxx https_proxy=xxx http_proxy=xxx noproxy=xxx SHLVL=1 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin =/usr/bin/env

watson commented 6 years ago

Hmm... those are all very generic I think. Any idea of what else we can look at to detect the correct environment?

oliveti commented 6 years ago

I do not really know what could be used here. For now I export an environment variable (CI) in my docker image.

watson commented 6 years ago

Hm, yeah the issue is probably that since this is something that people run inside their own Docker images, there's no guarantee that they export/use any environment variables that we can detect.

I've opened an issue on the Concourse GitHub repo asking for help: concourse/concourse#2105

watson commented 6 years ago

@oliveti Concourse is asking about your use-case for knowing if your code is running inside Concourse. Would you mind going to the issue and comment?

oliveti commented 6 years ago

Hi,

Just did it here.

Thank you for the report to concourse.