Skip to content

Commit

Permalink
fix(anonymizer): add role to pg_restore
Browse files Browse the repository at this point in the history
  • Loading branch information
gary-van-woerkens committed Jun 21, 2024
1 parent f0c7752 commit eabade8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .kontinuous/env/dev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,19 @@ jobs-restore-anonymization:
secretKeyRef:
name: pg-superuser
key: password
- name: PGUSERAPP
valueFrom:
secretKeyRef:
name: pg-app
key: PGUSER
run: |
set -e
root_path=domifa-dev-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 --no-acl --verbose /tmp/dump/$last_dir --dbname $PGDATABASE
pg_restore --clean --if-exists --no-owner --role=$PGUSERAPP --no-acl --verbose /tmp/dump/$last_dir --dbname $PGDATABASE
backend: &backendDev
~needs: [build-backend, pg]
Expand Down

0 comments on commit eabade8

Please sign in to comment.