Skip to content

Commit

Permalink
chore: for testing purposes
Browse files Browse the repository at this point in the history
still waiting for the access to the secrets
  • Loading branch information
v1v committed Aug 16, 2023
1 parent 2df0e27 commit da7b58b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ retry() {
return 0
}

echo "--- Prepare vault context :vault:"
CI_DRA_ROLE_PATH="kv/ci-shared/release/dra-role"
DRA_CREDS_SECRET=$(retry 5 vault kv get -field=data -format=json ${CI_DRA_ROLE_PATH})
VAULT_ADDR_SECRET=$(echo ${DRA_CREDS_SECRET} | jq -r '.vault_addr')
VAULT_ROLE_ID_SECRET=$(echo ${DRA_CREDS_SECRET} | jq -r '.role_id')
VAULT_SECRET=$(echo ${DRA_CREDS_SECRET} | jq -r '.secret_id')
export VAULT_ADDR_SECRET VAULT_ROLE_ID_SECRET VAULT_SECRET

echo "--- Prepare docker context :docker:"
DOCKER_REGISTRY_SECRET_PATH="secret/ci/elastic-apm-server/docker-elastic-observability"
DOCKER_USERNAME_SECRET=$(retry 5 vault kv get -field username "${DOCKER_REGISTRY_SECRET_PATH}")
Expand All @@ -46,3 +38,13 @@ DOCKER_REGISTRY_SECRET=$(retry 5 vault kv get -field registry "${DOCKER_REGISTRY
docker login -u "${DOCKER_USERNAME_SECRET}" -p "${DOCKER_PASSWORD_SECRET}" "${DOCKER_REGISTRY_SECRET}" 2>/dev/null
unset DOCKER_USERNAME_SECRET DOCKER_PASSWORD_SECRET
export DOCKER_REGISTRY_SECRET

exit 0

echo "--- Prepare vault context :vault:"
CI_DRA_ROLE_PATH="kv/ci-shared/release/dra-role"
DRA_CREDS_SECRET=$(retry 5 vault kv get -field=data -format=json ${CI_DRA_ROLE_PATH})
VAULT_ADDR_SECRET=$(echo ${DRA_CREDS_SECRET} | jq -r '.vault_addr')
VAULT_ROLE_ID_SECRET=$(echo ${DRA_CREDS_SECRET} | jq -r '.role_id')
VAULT_SECRET=$(echo ${DRA_CREDS_SECRET} | jq -r '.secret_id')
export VAULT_ADDR_SECRET VAULT_ROLE_ID_SECRET VAULT_SECRET

0 comments on commit da7b58b

Please sign in to comment.