Skip to content

Commit dc0a073

Browse files
committed
Token: Use same Organization token for every deployment
Since API Key mau be defined globally for every resource of an organization, we can simplify the `deploy-all.sh` script, and use always the token behind secret Key `ORGANIZATION_DEMO_BUMP_TOKEN`.
1 parent 10800fe commit dc0a073

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

.github/scripts/deploy-all.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ shopt -s nullglob
88
# Install bump-cli
99
npm install -g bump-cli
1010

11+
orgaTokenKey="ORGANIZATION_DEMO_BUMP_TOKEN"
12+
echo "Using global token ${orgaTokenKey} for Bump.sh Demo organization"
13+
1114
# For each directory in the hubs/ directory
1215
for hub in hubs/*/; do
1316
for api in "${hub}"*-source.{yml,yaml,json}; do
@@ -33,10 +36,8 @@ for hub in hubs/*/; do
3336
done
3437

3538
# Create documentation <apiName> from the api definition file
36-
tokenKey="${hubName//-/_}_BUMP_TOKEN"
37-
tokenKey="${tokenKey^^}"
38-
echo "* API ${apiName} (reading token from ${tokenKey})"
39-
bump deploy --doc "${apiName}" --token "${!tokenKey}" --hub "${hubName}" --auto-create "${api}"
39+
echo "* API ${apiName} (reading token from ${orgaTokenKey})"
40+
bump deploy --doc "${apiName}" --token "${!orgaTokenKey}" --hub "${hubName}" --auto-create "${api}"
4041
done
4142
done
4243

@@ -46,14 +47,12 @@ for api in apis/*-source.{yml,yaml,json}; do
4647
echo "Deploying ${api}"
4748

4849
# Extract the API name from filename `<api_name>-<spec>-source.yaml`
50+
# Create documentation <apiName> from the api definition file
4951
apiName="${api%-*}"
5052
apiName="${apiName%-*}"
5153
apiName="${apiName#*/}"
5254
apiName="${apiName#*/}"
5355

54-
# Create documentation <apiName> from the api definition file
55-
tokenKey="${apiName//-/_}_BUMP_TOKEN"
56-
tokenKey="${tokenKey^^}"
57-
echo "* API ${apiName} (reading token from ${tokenKey}) from file ${api}"
58-
bump deploy --doc "${apiName}" --token "${!tokenKey}" "${api}"
56+
echo "* API ${apiName} (reading token from ${orgaTokenKey}) from file ${api}"
57+
bump deploy --doc "${apiName}" --token "${!orgaTokenKey}" "${api}"
5958
done

0 commit comments

Comments
 (0)