8
8
delay : 10
9
9
timeout : 300
10
10
11
- # Non-zero status means setup:upgrade is required
12
- # bin/magento setup:db:status
13
- # systemctl stop supervisord
14
-
15
- # su - {{ magento_user }} -c 'php {{ magento_live_release_dir }}/bin/magento maintenance:enable'
16
- # su - {{ magento_user }} -c 'php {{ magento_live_release_dir }}/bin/magento setup:upgrade --keep-generated'
17
- # su - {{ magento_user }} -c 'php {{ magento_live_release_dir }}/bin/magento maintenance:disable'
18
-
19
- # systemctl start supervisord
20
11
- hosts : app:¤t
21
12
gather_facts : no
22
13
tasks :
23
- - name : Run Magento setup upgrade
14
+ - name : Run Magento post-deploy setup
24
15
command : " {{ item.cmd | default(item) }}"
25
16
args :
26
17
chdir : " {{ item.dir | default(magento_live_release_dir) }}"
27
18
run_once : true
28
19
become : yes
29
20
become_user : " {{ magento_user }}"
30
- loop :
31
- - " bin/magento app:config:import --no-interaction"
32
- - " bin/magento setup:upgrade --keep-generated"
33
- - " bin/magento maintenance:disable"
34
- # - "bin/magento cache:flush full_page"
35
- - " {{ magento_live_release_dir }}{{ magento_node_warmup_script_path }}"
21
+ loop : " {{ commands_base + magento_post_deploy_commands | default([]) }}"
36
22
loop_control :
37
23
label : " {{ item.cmd | default(item) }}"
38
24
register : out
25
+ vars :
26
+ commands_base :
27
+ - " bin/magento app:config:import --no-interaction"
28
+ - " bin/magento setup:upgrade --keep-generated"
29
+ - " bin/magento maintenance:disable"
39
30
40
- - name : Show Magento post-deploy command output
31
+ - name : Show Magento post-deploy output
41
32
debug :
42
33
msg : " {{ result.stdout | default('--- N/A ---') }}"
43
34
loop : " {{ out.results }}"
44
35
loop_control :
45
36
loop_var : result
46
37
label : " {{ result.cmd | default([]) | join(' ') }}"
47
38
48
- - hosts : app:¤t
49
- gather_facts : no
50
- tasks :
51
- - name : Run Magento post-deploy commands
52
- command : " {{ item.cmd | default(item) }}"
53
- args :
54
- chdir : " {{ item.dir | default(magento_live_release_dir) }}"
55
- run_once : true
56
- become : yes
57
- become_user : " {{ magento_user }}"
58
- loop : " {{ magento_post_deploy_commands | default([]) }}"
39
+ - name : Start Magento services
40
+ service :
41
+ name : " {{ service_name }}"
42
+ state : started
43
+ loop :
44
+ - magento-node-warmup.service
45
+ - supervisord.service
59
46
loop_control :
60
- label : " {{ item.cmd | default(item) }}"
61
- register : out
62
-
63
- - name : Show Magento post-deploy command output
64
- debug :
65
- msg : " {{ result.stdout | default('--- N/A ---') }}"
66
- loop : " {{ out.results }}"
67
- loop_control :
68
- loop_var : result
69
- label : " {{ result.cmd | default([]) | join(' ') }}"
70
-
71
-
72
- - hosts : app:¤t
73
- gather_facts : no
74
- tasks :
75
- - name : Start supervisord Magento workers
76
- command : /usr/bin/systemctl start supervisord
47
+ loop_var : service_name
48
+
0 commit comments