fix(contributing): runnig formula inside container

This commit is contained in:
LitniAlex 2020-06-25 14:35:50 +03:00
parent 26f3fa2f90
commit 68a791ef09
3 changed files with 10 additions and 4 deletions

View file

@ -35,6 +35,7 @@
prepare_cluster:
pgcommand: pg_createcluster {{ version }} {{ cluster_name }} -d
user: root
bake_image_run_cmd: pg_ctlcluster {{ version }} {{ cluster_name }} start
{% endmacro %}

View file

@ -76,6 +76,7 @@ postgres:
sysrc: false
bake_image: false
bake_image_run_cmd: echo "do nothing by default"
fromrepo: ''

View file

@ -10,15 +10,19 @@ include:
# An attempt to start PostgreSQL with `pg_ctl`
postgresql-start:
postgresql-running:
cmd.run:
- name: pg_ctl -D {{ postgres.data_dir }} -l logfile start
- name: {{ postgres.bake_image_run_cmd }}
- runas: {{ postgres.user }}
- unless:
- ps -p $(head -n 1 {{ postgres.data_dir }}/postmaster.pid) 2>/dev/null
- require:
- file: postgresql-pg_hba
postgresql-service-reload:
test.show_notification:
- text: Imitating reload while baking an image
# Try to enable PostgreSQL in "manual" way
postgresql-enable:
@ -34,11 +38,11 @@ postgresql-enable:
- name: 'true'
{%- endif %}
- require:
- cmd: postgresql-start
- cmd: postgresql-running
{%- else %}
postgresql-start:
postgresql-running:
test.show_notification:
- text: The 'postgres:bake_image' Pillar is disabled (set to 'False').