Skip to content

Commit

Permalink
fix(anonymizer): use PGDATABASE
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-van-woerkens committed Jul 11, 2024
1 parent 2ad67c7 commit 73bbfb0
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .kontinuous/env/prod/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,26 +201,31 @@ jobs-restore-anonymous-prod:
secretKeyRef:
name: domifa-prod-backups-access-key
key: bucket_endpoint
- name: PGUSER
valueFrom:
secretKeyRef:
name: managed-db-admin-anonymous
key: ADMIN_PG_USER
- name: PGPASSWORD
# - name: PGUSER
# valueFrom:
# secretKeyRef:
# name: managed-db-admin-anonymous
# key: ADMIN_PG_USER
# - name: PGPASSWORD
# valueFrom:
# secretKeyRef:
# name: managed-db-admin-anonymous
# key: ADMIN_PG_PASSWORD
- name: PGUSERAPP
valueFrom:
secretKeyRef:
name: managed-db-admin-anonymous
key: ADMIN_PG_PASSWORD
- name: PGUSERAPP
key: PGUSER
- name: PGDATABASE
valueFrom:
secretKeyRef:
name: managed-db-admin-anonymous
key: PGUSER
key: PGHOST
run: |
set -e
root_path=domifa-prod-backups/anonymizer/pg_dumps
last_dir=$(aws s3 ls s3://$root_path --recursive | awk '{print $4}' | cut -d "/" -f3 | tail -n 1)
echo "Restoring $last_dir"
aws s3 cp --recursive s3://$root_path/$last_dir /tmp/dump/$last_dir
export PGSSLMODE=disable
pg_restore --clean --if-exists --no-owner --role=$PGUSERAPP --no-acl --verbose /tmp/dump/$last_dir --dbname defaultdb
pg_restore --clean --if-exists --no-owner --role=$PGUSERAPP --no-acl --verbose /tmp/dump/$last_dir

0 comments on commit 73bbfb0

Please sign in to comment.