Skip to content

Commit

Permalink
make scripts more defensive in terms of security
Browse files Browse the repository at this point in the history
  • Loading branch information
dliappis committed Apr 26, 2024
1 parent ee7c416 commit bcccc3c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .buildkite/scripts/dra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# DRY_RUN=""
# fi


# TODO: delete the conditional below (and replace it with the above, uncommented out, section) after Jenkins packaging has been stopped
if [[ "$DRY_RUN" == "false" ]]; then
echo "~~~ Running in publish mode"
Expand Down Expand Up @@ -43,14 +42,17 @@ function release_manager_login {
export VAULT_ADDR_SECRET VAULT_ROLE_ID_SECRET VAULT_SECRET
}

set +x
release_manager_login


# required by the release-manager docker image, otherwise we hit:
# > java.io.FileNotFoundException: /artifacts/build/distributions/agentbeat/agentbeat-8.15.0-SNAPSHOT-darwin-x86_64.tar.gz.sha512 (Permission denied)
chmod -R a+r build/*
chmod -R a+w build

echo "+++ :clipboard: Listing DRA artifacts for branch [$BRANCH] using workflow[$DRA_WORKFLOW]"
echo "+++ :clipboard: Listing DRA artifacts for branch [$BRANCH] using workflow [$DRA_WORKFLOW]"
set +x
docker run --rm \
--name release-manager \
-e VAULT_ADDR="${VAULT_ADDR_SECRET}" \
Expand All @@ -67,6 +69,8 @@ docker run --rm \
--artifact-set "main"

echo "+++ :hammer_and_pick: Publishing DRA artifacts for branch [$BRANCH] using workflow [$DRA_WORKFLOW] and DRY_RUN: [$DRY_RUN]"

set +x
docker run --rm \
--name release-manager \
-e VAULT_ADDR="${VAULT_ADDR_SECRET}" \
Expand Down

0 comments on commit bcccc3c

Please sign in to comment.