Skip to content

Commit df397d8

Browse files
committed
set env var for concourse tasks - it is a convention some tools check for
1 parent 3d62bd0 commit df397d8

File tree

39 files changed

+124
-10
lines changed

39 files changed

+124
-10
lines changed

.github/workflows/for-dependabot-to-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ jobs:
168168
"ARTIFACTORY_URL"
169169
"ARTIFACTORY_USERNAME"
170170
"BUILD_VERSION"
171+
"CI"
171172
"GIT_REVISION"
172173
"RUNNING_IN_CI"
173174
context: .

defaults/tasks_env_defaulter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func (t tasksEnvVarsDefaulter) addDefaultsToVars(vars manifest.Vars, defaults De
2020
vars["ARTIFACTORY_USERNAME"] = defaults.Artifactory.Username
2121
vars["ARTIFACTORY_PASSWORD"] = defaults.Artifactory.Password
2222
vars["RUNNING_IN_CI"] = "true"
23+
vars["CI"] = "true"
2324

2425
return vars
2526
}

defaults/tasks_env_defaulter_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package defaults
22

33
import (
4+
"testing"
5+
46
"github.com/springernature/halfpipe/manifest"
57
"github.com/stretchr/testify/assert"
6-
"testing"
78
)
89

910
func TestSetsCorrectEnvVarsToEmptyVars(t *testing.T) {
@@ -12,6 +13,7 @@ func TestSetsCorrectEnvVarsToEmptyVars(t *testing.T) {
1213
"ARTIFACTORY_USERNAME": Concourse.Artifactory.Username,
1314
"ARTIFACTORY_PASSWORD": Concourse.Artifactory.Password,
1415
"RUNNING_IN_CI": "true",
16+
"CI": "true",
1517
}
1618

1719
input := manifest.TaskList{

e2e/actions/deploy-katee/workflowExpected.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
"ARTIFACTORY_URL"
4545
"ARTIFACTORY_USERNAME"
4646
"BUILD_VERSION"
47+
"CI"
4748
"GIT_REVISION"
4849
"RUNNING_IN_CI"
4950
context: e2e/actions/deploy-katee

e2e/actions/docker-push-aws/workflowExpected.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
--build-arg ARTIFACTORY_URL \
7575
--build-arg ARTIFACTORY_USERNAME \
7676
--build-arg BUILD_VERSION \
77+
--build-arg CI \
7778
--build-arg GIT_REVISION \
7879
--build-arg RUNNING_IN_CI \
7980
-t $ECR_REGISTRY/example-app:$IMAGE_TAG \
@@ -144,6 +145,7 @@ jobs:
144145
--build-arg ARTIFACTORY_USERNAME \
145146
--build-arg B \
146147
--build-arg BUILD_VERSION \
148+
--build-arg CI \
147149
--build-arg GIT_REVISION \
148150
--build-arg RUNNING_IN_CI \
149151
--secret id=C,env=C \

e2e/actions/docker-push-simple/workflowExpected.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
"ARTIFACTORY_URL"
4242
"ARTIFACTORY_USERNAME"
4343
"BUILD_VERSION"
44+
"CI"
4445
"GIT_REVISION"
4546
"RUNNING_IN_CI"
4647
context: e2e/actions/docker-push-simple

e2e/actions/docker-push/workflowExpected.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
"ARTIFACTORY_URL"
8989
"ARTIFACTORY_USERNAME"
9090
"BUILD_VERSION"
91+
"CI"
9192
"GIT_REVISION"
9293
"RUNNING_IN_CI"
9394
context: e2e/actions/docker-push
@@ -136,6 +137,7 @@ jobs:
136137
"ARTIFACTORY_URL"
137138
"ARTIFACTORY_USERNAME"
138139
"BUILD_VERSION"
140+
"CI"
139141
"GIT_REVISION"
140142
"RUNNING_IN_CI"
141143
context: e2e/actions/docker-push
@@ -190,6 +192,7 @@ jobs:
190192
"ARTIFACTORY_USERNAME"
191193
"B=b"
192194
"BUILD_VERSION"
195+
"CI"
193196
"GIT_REVISION"
194197
"RUNNING_IN_CI"
195198
context: e2e/actions/docker-push
@@ -233,6 +236,7 @@ jobs:
233236
"ARTIFACTORY_URL"
234237
"ARTIFACTORY_USERNAME"
235238
"BUILD_VERSION"
239+
"CI"
236240
"GIT_REVISION"
237241
"RUNNING_IN_CI"
238242
context: e2e/actions/docker-push

e2e/concourse/artifacts/pipelineExpected.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
ARTIFACTORY_PASSWORD: ((artifactory.password))
3939
ARTIFACTORY_URL: ((artifactory.url))
4040
ARTIFACTORY_USERNAME: ((artifactory.username))
41+
CI: "true"
4142
RUNNING_IN_CI: "true"
4243
platform: linux
4344
run:
@@ -160,6 +161,7 @@ jobs:
160161
ARTIFACTORY_PASSWORD: ((artifactory.password))
161162
ARTIFACTORY_URL: ((artifactory.url))
162163
ARTIFACTORY_USERNAME: ((artifactory.username))
164+
CI: "true"
163165
RUNNING_IN_CI: "true"
164166
platform: linux
165167
run:
@@ -308,6 +310,7 @@ jobs:
308310
ARTIFACTORY_PASSWORD: ((artifactory.password))
309311
ARTIFACTORY_URL: ((artifactory.url))
310312
ARTIFACTORY_USERNAME: ((artifactory.username))
313+
CI: "true"
311314
RUNNING_IN_CI: "true"
312315
TEST_ROUTE: halfpipe-example-kotlin-dev-staging-CANDIDATE.springernature.app
313316
platform: linux
@@ -461,6 +464,7 @@ jobs:
461464
ARTIFACTORY_URL: ((artifactory.url))
462465
ARTIFACTORY_USERNAME: ((artifactory.username))
463466
B: b
467+
CI: "true"
464468
DOCKER_CONFIG_JSON: ((halfpipe-gcr.docker_config))
465469
RUNNING_IN_CI: "true"
466470
platform: linux
@@ -480,6 +484,7 @@ jobs:
480484
--build-arg ARTIFACTORY_URL \
481485
--build-arg ARTIFACTORY_USERNAME \
482486
--build-arg B \
487+
--build-arg CI \
483488
--build-arg RUNNING_IN_CI \
484489
--secret id=ARTIFACTORY_PASSWORD \
485490
--secret id=ARTIFACTORY_URL \
@@ -496,6 +501,7 @@ jobs:
496501
--build-arg ARTIFACTORY_URL \
497502
--build-arg ARTIFACTORY_USERNAME \
498503
--build-arg B \
504+
--build-arg CI \
499505
--build-arg RUNNING_IN_CI \
500506
--secret id=ARTIFACTORY_PASSWORD \
501507
--secret id=ARTIFACTORY_URL \
@@ -624,6 +630,7 @@ jobs:
624630
ARTIFACTORY_PASSWORD: ((artifactory.password))
625631
ARTIFACTORY_URL: ((artifactory.url))
626632
ARTIFACTORY_USERNAME: ((artifactory.username))
633+
CI: "true"
627634
GCR_PRIVATE_KEY: ((halfpipe-gcr.private_key))
628635
HALFPIPE_CACHE_TEAM: halfpipe-team
629636
RUNNING_IN_CI: "true"
@@ -651,7 +658,7 @@ jobs:
651658
export GIT_REVISION=`cat ../../../.git/ref`
652659
653660
\echo "$GCR_PRIVATE_KEY" | docker login -u _json_key --password-stdin https://eu.gcr.io
654-
docker-compose run --use-aliases -e A -e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e DOCKER_HOST="${DIND_HOST}" -e GIT_REVISION -e HALFPIPE_CACHE_TEAM -e RUNNING_IN_CI -v /var/halfpipe/cache:/var/halfpipe/cache -v /var/halfpipe/shared-cache:/var/halfpipe/shared-cache app
661+
docker-compose run --use-aliases -e A -e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e CI -e DOCKER_HOST="${DIND_HOST}" -e GIT_REVISION -e HALFPIPE_CACHE_TEAM -e RUNNING_IN_CI -v /var/halfpipe/cache:/var/halfpipe/cache -v /var/halfpipe/shared-cache:/var/halfpipe/shared-cache app
655662
656663
EXIT_STATUS=$?
657664
if [ $EXIT_STATUS != 0 ] ; then
@@ -809,6 +816,7 @@ jobs:
809816
ARTIFACTORY_PASSWORD: ((artifactory.password))
810817
ARTIFACTORY_URL: ((artifactory.url))
811818
ARTIFACTORY_USERNAME: ((artifactory.username))
819+
CI: "true"
812820
CONSUMER_GIT_KEY: ((halfpipe-github.private_key))
813821
CONSUMER_GIT_URI: git@github.com:springernature/c-consumer
814822
CONSUMER_HOST: c-host
@@ -846,7 +854,7 @@ jobs:
846854
export GIT_REVISION=`cat ../../../.git/ref`
847855
848856
\echo "$GCR_PRIVATE_KEY" | docker login -u _json_key --password-stdin https://eu.gcr.io
849-
export ENV_OPTIONS="-e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e RUNNING_IN_CI"
857+
export ENV_OPTIONS="-e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e CI -e RUNNING_IN_CI"
850858
export VOLUME_OPTIONS="-v /var/halfpipe/cache:/var/halfpipe/cache -v /var/halfpipe/shared-cache:/var/halfpipe/shared-cache -v /var/run/docker.sock:/var/run/docker.sock"
851859
run-cdc.sh
852860
EXIT_STATUS=$?

e2e/concourse/consumer-integration-test/pipelineExpected.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
ARTIFACTORY_PASSWORD: ((artifactory.password))
2929
ARTIFACTORY_URL: ((artifactory.url))
3030
ARTIFACTORY_USERNAME: ((artifactory.username))
31+
CI: "true"
3132
CONSUMER_GIT_KEY: ((halfpipe-github.private_key))
3233
CONSUMER_GIT_URI: git@github.com:springernature/c-consumer
3334
CONSUMER_HOST: c-host
@@ -54,7 +55,7 @@ jobs:
5455
export GIT_REVISION=`cat ../../../.git/ref`
5556
5657
\echo "$GCR_PRIVATE_KEY" | docker login -u _json_key --password-stdin https://eu.gcr.io
57-
export ENV_OPTIONS="-e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e K -e K1 -e RUNNING_IN_CI"
58+
export ENV_OPTIONS="-e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e CI -e K -e K1 -e RUNNING_IN_CI"
5859
export VOLUME_OPTIONS="-v /var/halfpipe/cache:/var/halfpipe/cache -v /var/halfpipe/shared-cache:/var/halfpipe/shared-cache -v /var/run/docker.sock:/var/run/docker.sock"
5960
run-cdc.sh
6061
EXIT_STATUS=$?
@@ -97,6 +98,7 @@ jobs:
9798
ARTIFACTORY_PASSWORD: ((artifactory.password))
9899
ARTIFACTORY_URL: ((artifactory.url))
99100
ARTIFACTORY_USERNAME: ((artifactory.username))
101+
CI: "true"
100102
CONSUMER_GIT_KEY: ((halfpipe-github.private_key))
101103
CONSUMER_GIT_URI: git@github.com:springernature/c-consumer
102104
CONSUMER_HOST: c-host
@@ -123,7 +125,7 @@ jobs:
123125
export GIT_REVISION=`cat ../../../.git/ref`
124126
125127
\echo "$GCR_PRIVATE_KEY" | docker login -u _json_key --password-stdin https://eu.gcr.io
126-
export ENV_OPTIONS="-e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e K -e K1 -e RUNNING_IN_CI"
128+
export ENV_OPTIONS="-e ARTIFACTORY_PASSWORD -e ARTIFACTORY_URL -e ARTIFACTORY_USERNAME -e CI -e K -e K1 -e RUNNING_IN_CI"
127129
export VOLUME_OPTIONS="-v /var/halfpipe/cache:/var/halfpipe/cache -v /var/halfpipe/shared-cache:/var/halfpipe/shared-cache -v /var/run/docker.sock:/var/run/docker.sock"
128130
run-cdc.sh
129131
EXIT_STATUS=$?

e2e/concourse/deploy-cf-docker-image/pipelineExpected.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ jobs:
171171
ARTIFACTORY_PASSWORD: ((artifactory.password))
172172
ARTIFACTORY_URL: ((artifactory.url))
173173
ARTIFACTORY_USERNAME: ((artifactory.username))
174+
CI: "true"
174175
RUNNING_IN_CI: "true"
175176
TEST_ROUTE: halfpipe-example-kotlin-dev-dev-CANDIDATE.springernature.app
176177
platform: linux
@@ -331,6 +332,7 @@ jobs:
331332
ARTIFACTORY_PASSWORD: ((artifactory.password))
332333
ARTIFACTORY_URL: ((artifactory.url))
333334
ARTIFACTORY_USERNAME: ((artifactory.username))
335+
CI: "true"
334336
RUNNING_IN_CI: "true"
335337
TEST_ROUTE: halfpipe-example-kotlin-dev-dev-CANDIDATE.springernature.app
336338
platform: linux

0 commit comments

Comments
 (0)