File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
main/java/io/spring/ge/conventions/gradle
test/java/io/spring/ge/conventions/gradle Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ private void tagCiOrLocal(BuildScanExtension buildScan) {
9898}
9999
100100private boolean isCi () {
101- if (isBamboo () || isConcourse () || isJenkins ()) {
101+ if (isBamboo () || isCircleCi () || isConcourse () || isJenkins ()) {
102102return true ;
103103}
104104return false ;
@@ -108,6 +108,10 @@ private boolean isBamboo() {
108108return this .env .containsKey (BAMBOO_RESULTS_ENV_VAR );
109109}
110110
111+ private boolean isCircleCi () {
112+ return this .env .containsKey ("CIRCLECI" );
113+ }
114+
111115private boolean isConcourse () {
112116return this .env .containsKey ("CI" );
113117}
@@ -157,6 +161,9 @@ else if (isJenkins()) {
157161buildScan .link ("CI build" , buildUrl );
158162}
159163}
164+ else if (isCircleCi ()) {
165+ buildScan .link ("CI build" , this .env .get ("CIRCLE_BUILD_URL" ));
166+ }
160167}
161168
162169private RunResult getBranch () {
Original file line number Diff line number Diff line change @@ -81,6 +81,15 @@ void whenBambooResultEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt() {
8181assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://bamboo.example.com" );
8282}
8383
84+ @ Test
85+ void whenCircleCiAndCircleBuildUrlEnvVarsArePresentThenBuildScanHasACiBuildLinkToIt () {
86+ Map <String , String > env = new HashMap <>();
87+ env .put ("CIRCLECI" , "true" );
88+ env .put ("CIRCLE_BUILD_URL" , "https://circleci.example.com/gh/org/project/123" );
89+ new BuildScanConventions (this .processRunner , env ).execute (this .buildScan );
90+ assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://circleci.example.com/gh/org/project/123" );
91+ }
92+
8493@ Test
8594void whenJenkinsUrlAndBuildUrlEnvVarsArePresentThenBuildScanHasACiBuildLinkToBuildUrl () {
8695Map <String , String > env = new HashMap <>();
You can’t perform that action at this time.
0 commit comments