瀏覽代碼

Ensure psql returns a failure exit code when it fails

Until now, if the .sql file contained invalid data, psql would
choke on it, but still return an exit code of 0.
This is very misleading.

We need to pass `-v ON_ERROR_STOP=1` to make it exit
with a proper error exit code when failures happen.
pull/66/head
Slavi Pantaleev 7 年之前
父節點
當前提交
f472c1b9e5
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      roles/matrix-server/tasks/upgrade_postgres.yml

+ 1
- 1
roles/matrix-server/tasks/upgrade_postgres.yml 查看文件

@@ -94,7 +94,7 @@
--network={{ matrix_docker_network }} \
--env-file={{ matrix_environment_variables_data_path }}/env-postgres-pgsql-docker \
-v {{ postgres_dump_dir }}:/in:ro \
{{ matrix_postgres_docker_image_latest }} psql -h matrix-postgres -f /in/{{ postgres_dump_name }}
{{ matrix_postgres_docker_image_latest }} psql -v ON_ERROR_STOP=1 -h matrix-postgres -f /in/{{ postgres_dump_name }}

- name: Delete Postgres database dump file
file:


Loading…
取消
儲存