Skip to content

Commit 3f3a11c

Browse files
pinkeenkrisdante
authored andcommittedMar 12, 2021
Temporarily comment out some steps
1 parent 459cfe0 commit 3f3a11c

10 files changed

+99
-59
lines changed
 

‎LIFECYCLE.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Delivery Lifecycle
2+
3+
## Build Release Source Artifact
4+
5+
0. Checkout Project Root
6+
- `git clone m2c/m2c`
7+
> Must contain:
8+
> * `composer.json`
9+
> * `auth.json.encrypted`
10+
1. Build Backend Dist
11+
- `ansible-vault --output=auth.json decrypt auth.json.encrypted`
12+
- `composer update`
13+
2. Build Frontend Dist
14+
- `yarn --frozen-lockfile`
15+
- `yarn build`
16+
3. Run Tests
17+
-
18+
19+
## Build Release Instance Image
20+
21+
## Update Live Instances with New Image
22+
23+
## Execute Post Deploy Actions on [single] New Instance

‎roles/cs.magento-configure/tasks/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
when: magento_consumer_workers_enable and magento_version is version('2.3', '>=')
4040

4141

42+

‎roles/cs.magento-configure/templates/magento_node_warmup.sh.j2

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ echo 'Waiting for php-fpm to come up...'
66
until pgrep php-fpm > /dev/null; do sleep 0.5s ; done
77

88
echo 'Waiting for nginx to come up...'
9-
until curl http://localhost:{{ nginx_app_port }}/static/deployed_version.txt -s -o /dev/null; do sleep 0.5s ; done
9+
until curl "http://localhost:{{ nginx_app_port }}/static/deployed_version.txt" -s -o /dev/null; do sleep 0.5s ; done
1010

1111
DELAY=1
12-
until su - {{ magento_user }} -c 'php {{ magento_live_release_dir }}/bin/magento -vvv cs:warm-node --local-url=http://localhost:{{ nginx_app_port }}';do
12+
until php "{{ magento_live_release_dir }}/bin/magento" -vvv cs:warm-node --local-url="http://localhost:{{ nginx_app_port }}" ; do
1313
sleep "$DELAY"
1414
DELAY=$((DELAY * 2))
1515
done
16+

‎roles/cs.supervisor/defaults/main.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
# name: "worker_name"
66
#
77
##
8-
supervisor_programs: []
8+
supervisor_programs: []
9+
supervisor_service_autostart: yes
10+
supervisor_service_initial_state: started

‎roles/cs.supervisor/files/supervisord.service

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[Unit]
22
Description=Supervisor process control system for UNIX
33
Documentation=http://supervisord.org
4-
After=network.target
4+
After=network.target var-www-magento-shared-var-global.mount
5+
ConditionPathExists=!{{ magento_live_release_dir }}/var/global/.maintenance.flag
56

67
[Service]
78
ExecStart=/usr/bin/supervisord -n -c /etc/supervisord.conf

‎roles/cs.supervisor/tasks/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@
5353
- name: Enable and start supervisord
5454
service:
5555
name: supervisord
56-
enabled: yes
57-
state: started
56+
enabled: "{{ supervisor_service_autostart }}"
57+
state: "{{ supervisor_service_initial_state }}"

‎site.step-10-infrastructure-aws.yml

+52-46
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,54 @@
11
- hosts: localhost
2-
connection: local
3-
gather_facts: false
4-
pre_tasks:
5-
- name: Collect minimum facts (we need date time stuff)
6-
setup:
7-
gather_subset: min
8-
roles:
9-
- role: cs.aws-vpc
10-
- role: cs.aws-security-group
11-
aws_security_group_rds_create: "{{ aws_rds_create }}"
12-
aws_security_group_redis_create: "{{ mageops_redis_create or mageops_redis_sessions_create }}"
13-
aws_security_group_rabbitmq_create: "{{ mageops_rabbitmq_create and magento_rabbitmq_queue }}"
14-
aws_security_group_elasticsearch_create: "{{ mageops_elasticsearch_create }}"
15-
- role: cs.aws-s3
16-
- role: cs.aws-cloudfront
17-
aws_cloudfront_use_lambda: "{{ aws_cloudfront_optimizing_edge_lambda_enable }}"
18-
aws_cloudfront_lambda_arn: "{{ aws_cloudfront_lambda_latest_arn | default(omit, true) }}"
19-
when: aws_cloudfront_distribution_create | bool
20-
- role: cs.aws-rds
21-
when: aws_rds_create
22-
- role: cs.aws-loadbalancer
23-
lb_ssl_cert: "{{ aws_elb_https_certificate_arn }}"
24-
lb_s3_logs_bucket: "{{ aws_s3_secret_bucket }}"
25-
lb_http_port: "{{ mageops_varnish_port }}"
26-
when: aws_elb_create
27-
- role: cs.aws-ami-facts
28-
- role: cs.aws-node-facts
29-
- role: cs.aws-node-varnish
30-
aws_varnish_node_root_device: "{{ aws_ami_root_device }}"
31-
aws_varnish_node_vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
32-
aws_varnish_instance_id: "{{ aws_varnish_node_instance.instance_id | default(false) }}"
33-
when: varnish_standalone
34-
- role: cs.aws-node-persistent
35-
aws_persistent_node_root_device: "{{ aws_ami_root_device }}"
36-
aws_persistent_node_vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
37-
aws_persistent_instance_id: "{{ aws_persistent_node_instance.instance_id | default(false) }}"
38-
- role: cs.mysql-configure
39-
mysql_user_localhost_access: "{{ not aws_rds_create }}"
40-
- role: cs.aws-lambda-varnish
41-
when: varnish_standalone
42-
- role: cs.aws-lambda-node-coordinator
43-
when: aws_magento_cron_enabled
44-
- role: cs.aws-lambda-import
45-
- role: cs.finalize
2+
gather_facts: no
463
tasks:
47-
- name: Refresh inventory to get info about newly created nodes
48-
meta: refresh_inventory
4+
- debug:
5+
msg: I do nothing!
6+
7+
# - hosts: localhost
8+
# connection: local
9+
# gather_facts: false
10+
# pre_tasks:
11+
# - name: Collect minimum facts (we need date time stuff)
12+
# setup:
13+
# gather_subset: min
14+
# roles:
15+
# - role: cs.aws-vpc
16+
# - role: cs.aws-security-group
17+
# aws_security_group_rds_create: "{{ aws_rds_create }}"
18+
# aws_security_group_redis_create: "{{ mageops_redis_create or mageops_redis_sessions_create }}"
19+
# aws_security_group_rabbitmq_create: "{{ mageops_rabbitmq_create and magento_rabbitmq_queue }}"
20+
# aws_security_group_elasticsearch_create: "{{ mageops_elasticsearch_create }}"
21+
# - role: cs.aws-s3
22+
# - role: cs.aws-cloudfront
23+
# aws_cloudfront_use_lambda: "{{ aws_cloudfront_optimizing_edge_lambda_enable }}"
24+
# aws_cloudfront_lambda_arn: "{{ aws_cloudfront_lambda_latest_arn | default(omit, true) }}"
25+
# when: aws_cloudfront_distribution_create | bool
26+
# - role: cs.aws-rds
27+
# when: aws_rds_create
28+
# - role: cs.aws-loadbalancer
29+
# lb_ssl_cert: "{{ aws_elb_https_certificate_arn }}"
30+
# lb_s3_logs_bucket: "{{ aws_s3_secret_bucket }}"
31+
# lb_http_port: "{{ mageops_varnish_port }}"
32+
# when: aws_elb_create
33+
# - role: cs.aws-ami-facts
34+
# - role: cs.aws-node-facts
35+
# - role: cs.aws-node-varnish
36+
# aws_varnish_node_root_device: "{{ aws_ami_root_device }}"
37+
# aws_varnish_node_vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
38+
# aws_varnish_instance_id: "{{ aws_varnish_node_instance.instance_id | default(false) }}"
39+
# when: varnish_standalone
40+
# - role: cs.aws-node-persistent
41+
# aws_persistent_node_root_device: "{{ aws_ami_root_device }}"
42+
# aws_persistent_node_vpc_subnet_id: "{{ aws_vpc_subnet_id }}"
43+
# aws_persistent_instance_id: "{{ aws_persistent_node_instance.instance_id | default(false) }}"
44+
# - role: cs.mysql-configure
45+
# mysql_user_localhost_access: "{{ not aws_rds_create }}"
46+
# - role: cs.aws-lambda-varnish
47+
# when: varnish_standalone
48+
# - role: cs.aws-lambda-node-coordinator
49+
# when: aws_magento_cron_enabled
50+
# - role: cs.aws-lambda-import
51+
# - role: cs.finalize
52+
# tasks:
53+
# - name: Refresh inventory to get info about newly created nodes
54+
# meta: refresh_inventory

‎site.step-40-app-node.yml

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575

7676
- role: cs.supervisor
7777
supervisor_programs: "{{ mageops_supervisor_programs_app_node }}"
78+
supervisor_service_autostart: no
79+
supervisor_service_initial_state: stopped
7880

7981
- role: cs.nginx-url-blacklist
8082

‎site.step-60-autoscaling.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,8 @@
7070
{{ aws_app_node_launch_script_extra }}
7171
{% if not magento_aws_ondemand_import_instance_enable and magento_import_dispatcher_enable %}{{ magento_import_dispatcher_switch_script_path }} on{% endif %}
7272
73-
# TODO-DEPLOY-NEXT: Add this check to supervisord unit file - auto stop/start
74-
# when this file is created / removed. Make sure the service starts after
75-
# NFS mount is ready. Also add this to extra-instances.
76-
if [ ! -f "{{ magento_live_release_dir }}/var/global/.maintenance.flag" ] ; then
77-
/usr/bin/systemctl start supervisord
78-
fi
73+
/usr/bin/systemctl enable supervisord
74+
/usr/bin/systemctl start supervisord
7975
8076
- role: cs.aws-autoscaling
8177
when: aws_extra_app_asg_enable or magento_aws_ondemand_import_instance_enable
@@ -119,4 +115,7 @@
119115
}}
120116
autoscaling_instance_start_script: |
121117
{{ aws_app_node_launch_script_extra }}
122-
{% if magento_import_dispatcher_enable %}{{ magento_import_dispatcher_switch_script_path }} on{% endif %}
118+
{% if magento_import_dispatcher_enable %}{{ magento_import_dispatcher_switch_script_path }} on{% endif %}
119+
120+
/usr/bin/systemctl enable supervisord
121+
/usr/bin/systemctl start supervisord

‎site.step-65-post-deploy.yml

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
become: yes
2828
become_user: "{{ magento_user }}"
2929
loop:
30+
- "bin/magento app:config:import --no-interaction"
3031
- "bin/magento setup:upgrade --keep-generated"
3132
- "bin/magento maintenance:disable"
3233
# - "bin/magento cache:flush full_page"
@@ -66,3 +67,7 @@
6667
label: "{{ result.cmd | default([]) | join(' ') }}"
6768

6869

70+
- hosts: app:&current
71+
tasks:
72+
- name: Start supervisord Magento workers
73+
command: /usr/bin/systemctl start supervisord

0 commit comments

Comments
 (0)
Please sign in to comment.