diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index e5eb62a0f15..427b4a0f1ad 100755 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -91,9 +91,9 @@ PATH="${PATH}:$GOPATH:$GOPATH/bin" export PATH 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 +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 diff --git a/.buildkite/scripts/dra.sh b/.buildkite/scripts/dra.sh index 5fc329acef7..7522c2243d8 100644 --- a/.buildkite/scripts/dra.sh +++ b/.buildkite/scripts/dra.sh @@ -24,7 +24,8 @@ ls -l build/ if [[ "${BUILDKITE_PULL_REQUEST:-false}" == "false" ]]; then echo "--- :arrow_right: Release Manager does not run on PRs, skipping" - exit 0 + # TODO: for testing purposes + #exit 0 fi curl -s https://storage.googleapis.com/artifacts-api/snapshots/branches.json > active-branches.json @@ -35,12 +36,15 @@ if ! grep -q "\"$BUILDKITE_BRANCH\"" active-branches.json ; then echo "VERSION=$VERSION" echo "Supported branches:" cat active-branches.json - exit 0 + # TODO: for testing purposes + #exit 0 fi dra() { local workflow=$1 echo "--- Run release manager $workflow" + # TODO: for testing purposes let's force the branch + BUILDKITE_BRANCH=main docker run --rm \ --name release-manager \ -e VAULT_ADDR="${VAULT_ADDR_SECRET}" \ @@ -54,7 +58,9 @@ dra() { --commit $BUILDKITE_COMMIT \ --workflow $workflow \ --artifact-set main \ - --version $VERSION + --version $VERSION \ + --dry-run + ## TODO: for testing purposes it uses --dry-run } dra "snapshot"