File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,16 @@ parameters:
99 type : string
1010steps :
1111 - run :
12- name : Prepare script parameters
12+ name : Configure Cloudsmith organisation
13+ command : |
14+ if [ -z "$CLOUDSMITH_ORGANISATION" ]
15+ then
16+ echo "export CLOUDSMITH_ORGANISATION=\"financial-times\"" >> $BASH_ENV
17+ fi
18+ - run :
19+ name : Configure Cloudsmith service
1320 command : |
1421 echo "export CLOUDSMITH_SERVICE_IDENTIFIER=\"<<parameters.service_identifier>>\"" >> $BASH_ENV
1522 - run :
16- name : Authenticate with OIDC and generate a temporary OIDC token
23+ name : Authenticate with OIDC
1724 command : <<include(scripts/authenticate_with_oidc.sh)>>
Original file line number Diff line number Diff line change 55
66set +e
77
8+ if [ -z " $CLOUDSMITH_ORGANISATION " ]
9+ then
10+ echo " Unable to generate OIDC token. Environment variable CLOUDSMITH_ORGANISATION is not set."
11+ exit 1
12+ fi
13+
814if [ -z " $CLOUDSMITH_SERVICE_IDENTIFIER " ]
915then
1016 echo " Unable to generate OIDC token. Environment variable CLOUDSMITH_SERVICE_IDENTIFIER is not set."
1117 exit 1
1218fi
1319
14- echo " Generating Cloudsmith OIDC token for service account: $CLOUDSMITH_SERVICE_IDENTIFIER "
20+ echo " Generating Cloudsmith OIDC token for service account: $CLOUDSMITH_ORGANISATION / $ CLOUDSMITH_SERVICE_IDENTIFIER"
1521
1622RESPONSE=$( curl -X POST -H " Content-Type: application/json" \
1723 -d " {\" oidc_token\" :\" $CIRCLE_OIDC_TOKEN_V2 \" , \" service_slug\" :\" $CLOUDSMITH_SERVICE_IDENTIFIER \" }" \
18- --silent --show-error " https://api.cloudsmith.io/openid/financial-times /" )
24+ --silent --show-error " https://api.cloudsmith.io/openid/$CLOUDSMITH_ORGANISATION /" )
1925
2026CLOUDSMITH_OIDC_TOKEN=$( echo " $RESPONSE " | grep -o ' "token": "[^"]*' | grep -o ' [^"]*$' )
2127
You can’t perform that action at this time.
0 commit comments