Run koji-reset-staging.sql in a single db transaction

If the script fails for some reason, we want DB to be in consistent
state so that the script can be fixed and re-ran more easily.
This commit is contained in:
Mikolaj Izdebski 2018-02-28 17:31:31 +00:00
parent a97de30d27
commit 9a12f6bf79

View file

@ -71,9 +71,8 @@
# TODO: add pipe buffering
- name: Import the prod db. This will take quite a while. Go get a snack!
shell: curl https://infrastructure.fedoraproject.org/infra/db-dumps/koji.dump.xz | xzcat | sed '/COPY buildroot_listing /,/\./d' | psql koji
# TODO: whap sql script in a transaction
- name: repoint all the prod rpm entries at the secondary volume (and other stuff)
shell: psql koji < /var/lib/pgsql/koji-reset-staging.sql
shell: psql -1 koji </var/lib/pgsql/koji-reset-staging.sql
- name: vacuum database
shell: psql koji <<<"VACUUM ANALYZE"