Skip to content

Commit c51bf99

Browse files
committed
pull cmci creds from vault
Signed-off-by: Andrew Twydell <[email protected]>
1 parent 5508927 commit c51bf99

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

.travis/build_env.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ touch "$TRAVIS_BUILD_DIR"/tests/integration/targets/cics_cmci/cmci-variables.yml
2424
echo cmci_port: "$CMCI_PORT"
2525
echo cmci_secure_port: "$CMCI_SECURE_PORT"
2626
echo cmci_user: "$CMCI_USER"
27-
echo cmci_password: "$CMCI_PASSWORD"
27+
echo cmci_password: "$CMCI_PASS"
2828
echo cmci_context: "$CMCI_CONTEXT"
2929
echo cmci_scope: "$CMCI_SCOPE"
30-
echo cmci_scope_region_1: "$CMCI_SCOPE_REGION_1"
31-
echo cmci_scope_region_2: "$CMCI_SCOPE_REGION_2"
30+
echo cmci_scope_region_1: "$CMCI_REGION_1"
31+
echo cmci_scope_region_2: "$CMCI_REGION_2"
3232
echo cmci_program_name_1: "$program_name_1"
3333
echo cmci_program_name_2: "$program_name_2"
3434
echo cmci_program_filter: "$program_filter"

.travis/get_artifactory_creds.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

.travis/get_vault_data.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
# Wiki page on Vault Integration:
4+
# https://cicswiki.hursley.ibm.com:9443/wiki/CICS_Explorer/artifactory_vault
5+
6+
VAULT_ONETIME_TOKEN=$(curl -k -s --request POST --data '{"role_id":"'"$VAULT_ROLE_ID"'","secret_id":"'"$VAULT_SECRET_ID"'"}' "$VAULT_URL"/auth/approle/login | jq -r ".auth.client_token")
7+
ARTI=$(curl -k -s --header "X-Vault-Token: $VAULT_ONETIME_TOKEN" "$VAULT_URL"/"$VAULT_PATH"/"artifactory" | jq -r ".data.data")
8+
export "ARTIFACTORY_USER"="$(jq -r ".user" <<<"$ARTI")"
9+
export "ARTIFACTORY_TOKEN"="$(jq -r ".token" <<<"$ARTI")"
10+
11+
PLEX=$(curl -k -s --header "X-Vault-Token: $VAULT_ONETIME_TOKEN" "$VAULT_URL"/"$VAULT_PATH"/plex2 | jq -r ".data.data")
12+
export "CMCI_USER"="$(jq -r ".username" <<<"$PLEX")"
13+
export "CMCI_PASS"="$(jq -r ".password" <<<"$PLEX")"
14+
15+
CMCI=$(curl -k -s --header "X-Vault-Token: $VAULT_ONETIME_TOKEN" "$VAULT_URL"/"$VAULT_PATH"/cmci | jq -r ".data.data")
16+
export "CMCI_HOST"="$(jq -r ".url" <<<"$CMCI")"
17+
export "CMCI_PORT"="$(jq -r ".port" <<<"$CMCI")"
18+
export "CMCI_SECURE_PORT"="$(jq -r ".secure_port" <<<"$CMCI")"
19+
export "CMCI_SCOPE"="$(jq -r ".scope" <<<"$CMCI")"
20+
export "CMCI_REGION_1"="$(jq -r ".region_1" <<<"$CMCI")"
21+
export "CMCI_REGION_2"="$(jq -r ".region_2" <<<"$CMCI")"
22+
export "CMCI_CONTEXT"="$(jq -r ".context" <<<"$CMCI")"

0 commit comments

Comments
 (0)