Skip to content

Commit

Permalink
ci: fix performance feature branch using wrong db (#8835)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasBlaskey authored Feb 16, 2024
1 parent 47061fa commit 2a183da
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions .circleci/real_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2202,23 +2202,23 @@ jobs:
--tags "Key=ci-snapshot" \
--vpc-security-group-ids="${PERF_DB_SECURITY_GROUP_ID}" \
no_output_timeout: 30m
- run:
name: Wait for database to be ready
command: |
aws rds wait db-instance-available \
--region="us-west-2" \
--db-instance-identifier="ci-perf-db-${CIRCLE_BUILD_NUM}"
no_output_timeout: 30m
- run:
name: Get db instance host
command: |
echo "export RDS_HOST=$(aws rds describe-db-instances \
echo "export PERF_DB_HOST=$(aws rds describe-db-instances \
--region us-west-2 \
--db-instance-identifier "ci-perf-db-${CIRCLE_BUILD_NUM}" \
--query "DBInstances[0].Endpoint.Address" \
--output text)" >> "$BASH_ENV"
source $BASH_ENV
echo "perf db host ${PERF_DB_HOST}"
- run:
name: Wait for database to be ready
command: |
aws rds wait db-instance-available \
--region="us-west-2" \
--db-instance-identifier="ci-perf-db-${CIRCLE_BUILD_NUM}"
no_output_timeout: 30m
- run:
name: Add SSH key
Expand Down Expand Up @@ -2281,17 +2281,18 @@ jobs:
name: Upload result of performance test to Postgres result db
command: python .circleci/scripts/upload_perf_results.py ./performance/reports/latest.results.json

- when:
condition: <<parameters.deploy-db>>
- run:
name: Delete RDS instance
when: always
steps:
- run:
name: Delete RDS instance
command: |
aws rds delete-db-instance \
--region="us-west-2" \
--db-instance-identifier="ci-perf-db-${CIRCLE_BUILD_NUM}" \
--skip-final-snapshot
command: |
if [ -n "$PERF_SNAPSHOT_TO_USE" ]; then
aws rds delete-db-instance \
--region="us-west-2" \
--db-instance-identifier="ci-perf-db-${CIRCLE_BUILD_NUM}" \
--skip-final-snapshot
else
echo "PERF_SNAPSHOT_TO_USE is not set. Skipping deletion."
fi
- slack/status:
fail_only: true
Expand Down

0 comments on commit 2a183da

Please sign in to comment.