mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 11:01:44 +00:00
scripts: dont run subshell in for loop (#60611)
For same reason as https://github.com/sourcegraph/sourcegraph/pull/60610, cleaning up the remaining scripts ## Test plan https://stackoverflow.com/questions/44014857/function-invocation-in-for-loop-does-not-fail-even-with-set-e
This commit is contained in:
parent
b771497115
commit
4d76a70fa2
@ -17,7 +17,8 @@ GOOGLE_IMAGE_NAME="${NAME}"
|
||||
"$gcloud" compute images update --project=sourcegraph-ci "${GOOGLE_IMAGE_NAME}" --family="${IMAGE_FAMILY}"
|
||||
|
||||
if [ "${EXECUTOR_IS_TAGGED_RELEASE}" = "true" ]; then
|
||||
for region in $(jq -r '.[]' <aws_regions.json); do
|
||||
REGIONS=$(jq -r '.[]' <aws_regions.json)
|
||||
for region in $REGIONS; do
|
||||
AWS_AMI_ID=$(aws ec2 --region="${region}" describe-images --filter "Name=name,Values=${NAME}" --query 'Images[*].[ImageId]' --output text)
|
||||
# Make AMI usable outside of Sourcegraph.
|
||||
aws ec2 --region="${region}" modify-image-attribute --image-id "${AWS_AMI_ID}" --launch-permission "Add=[{Group=all}]"
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
for dbname in $(psql -Xc "copy (select datname from pg_database where datname like 'sourcegraph-test-%') to stdout"); do
|
||||
DB_NAMES=$(psql -Xc "copy (select datname from pg_database where datname like 'sourcegraph-test-%') to stdout")
|
||||
for dbname in $DB_NAMES; do
|
||||
dropdb "$dbname"
|
||||
echo "dropped $dbname"
|
||||
done
|
||||
|
||||
@ -63,7 +63,8 @@ TAG="${TAG:-${NEW_TAG:?"$MISSING_MESSAGE"}}"
|
||||
|
||||
NEW_TAG_AND_DIGEST="$(get_new_tag_and_digest "$NEW_IMAGE" "$TAG")"
|
||||
|
||||
for file in $(fd --glob Dockerfile\* .); do
|
||||
DOCKERFILES=$(fd --glob Dockerfile\* .)
|
||||
for file in $DOCKERFILES; do
|
||||
update_image_reference "$OLD_IMAGE" "$NEW_IMAGE" "$NEW_TAG_AND_DIGEST" "$file"
|
||||
echo "$file"
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user