Skip to content

Commit

Permalink
buildkite: use shared secret for obltmachine (#3656)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored May 30, 2024
1 parent 11e8e47 commit 33184bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 0 additions & 6 deletions .buildkite/hooks/prepare-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ ES_USER_SECRET=$(vault read -field=es_user secret/ci/elastic-apm-agent-java/open
ES_PASS_SECRET=$(vault read -field=es_pass secret/ci/elastic-apm-agent-java/opentelemetry-benchmark)
export ES_URL_SECRET ES_USER_SECRET ES_PASS_SECRET

echo "--- Prepare github secrets :vault:"
GITHUB_SECRET=$(vault kv get -field token "kv/ci-shared/observability-ci/github-bot-user")
GITHUB_USERNAME=$(vault kv get -field username "kv/ci-shared/observability-ci/github-bot-user")
GH_TOKEN=$GITHUB_SECRET
export GITHUB_SECRET GH_TOKEN GITHUB_USERNAME

echo "--- Install gh :github:"
GH_URL=https://github.com/cli/cli/releases/download/v2.37.0/gh_2.37.0_linux_amd64.tar.gz
GH_HOME=$(pwd)/.gh
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/hooks/prepare-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ fi

# Validate java is available in the runner.
java -version

echo "--- Prepare github secrets :vault:"
VAULT_SECRET_PATH=kv/ci-shared/observability-ci/github-bot-user
GITHUB_SECRET=$(vault kv get -field token "${VAULT_SECRET_PATH}")
GIT_USER=$(vault kv get -field username "${VAULT_SECRET_PATH}")
GIT_EMAIL=$(vault kv get -field email "${VAULT_SECRET_PATH}")
GH_TOKEN=$GITHUB_SECRET
export GITHUB_SECRET GH_TOKEN GIT_USER GIT_EMAIL
4 changes: 2 additions & 2 deletions .buildkite/hooks/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ echo "$KEYPASS_SECRET" | gpg --batch --import "$KEY_FILE"
echo "--- Configure git context :git:"
# Configure the committer since the maven release requires to push changes to GitHub
# This will help with the SLSA requirements.
git config --global user.email "[email protected]"
git config --global user.name "apmmachine"
git config --global user.email "${GIT_EMAIL}"
git config --global user.name "${GIT_USER}"

0 comments on commit 33184bc

Please sign in to comment.