Skip to content

Conversation

@shakuzen
Copy link
Contributor

Detects running on CircleCI and configures the build scan with a link to the CI build job URL.

}

private boolean isConcourse() {
return this.env.containsKey("CI");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CircleCI also sets an env var CI=true on its builds. I'm not sure if there is a more discerning env var for Concourse. Right now it is not practically an issue since CircleCI is checked before Concourse, but it does feel fragile to potential future changes in this code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concourse doesn't expose any environment variables by default. CI is something that we unimaginatively came up with ourselves and configure in our pipeline. We should change it to something more specific.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other CI systems that we support in the Common Custom User Data Gradle plugin, we detect the presence of the URL environment variable like so: https://github.com/gradle/gradle-enterprise-build-config-samples/blob/master/common-custom-user-data-gradle-plugin/src/main/java/com/gradle/CustomBuildScanEnhancements.java#L175

Detects running on CircleCI and configures the build scan with a link to the CI build job URL.
@wilkinsona wilkinsona added this to the 0.0.8 milestone May 20, 2021
@wilkinsona wilkinsona added the type: enhancement A general enhancement label May 20, 2021
wilkinsona pushed a commit that referenced this pull request Jul 21, 2021
Detects running on CircleCI and configures the build scan with a link to the CI build job URL. See gh-31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

3 participants