-
Notifications
You must be signed in to change notification settings - Fork 30
/
appspec.yml
132 lines (130 loc) · 5.82 KB
/
appspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# This is an appspec.yml template file for use with an EC2/On-Premises deployment in CodeDeploy.
# The lines in this template starting with the hashtag symbol are
# instructional comments and can be safely left in the file or
# ignored.
# For help completing this file, see the "AppSpec File Reference" in the
# "CodeDeploy User Guide" at
# https://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref.html
version: 0.0
os: linux
# During the Install deployment lifecycle event (which occurs between the
# BeforeInstall and AfterInstall events), copy the specified files
# in "source" starting from the root of the revision's file bundle
# to "destination" on the Amazon EC2 instance.
# Specify multiple "source" and "destination" pairs if you want to copy
# from multiple sources or to multiple destinations.
# If you are not copying any files to the Amazon EC2 instance, then remove the
# "files" section altogether. A blank or incomplete "files" section
# may cause associated deployments to fail.
files:
- source: /
destination: /var/www/polling_stations/code/
# For deployments to Amazon Linux, Ubuntu Server, or RHEL instances,
# you can specify a "permissions"
# section here that describes special permissions to apply to the files
# in the "files" section as they are being copied over to
# the Amazon EC2 instance.
# For more information, see the documentation.
# If you are deploying to Windows Server instances,
# then remove the
# "permissions" section altogether. A blank or incomplete "permissions"
# section may cause associated deployments to fail.
permissions:
- object: /var/www/polling_stations/code
pattern: "**"
owner: polling_stations
group: polling_stations
mode: 755
# If you are not running any commands on the Amazon EC2 instance, then remove
# the "hooks" section altogether. A blank or incomplete "hooks" section
# may cause associated deployments to fail.
hooks:
# For each deployment lifecycle event, specify multiple "location" entries
# if you want to run multiple scripts during that event.
# You can specify "timeout" as the number of seconds to wait until failing the deployment
# if the specified scripts do not run within the specified time limit for the
# specified event. For example, 900 seconds is 15 minutes. If not specified,
# the default is 1800 seconds (30 minutes).
# Note that the maximum amount of time that all scripts must finish executing
# for each individual deployment lifecycle event is 3600 seconds (1 hour).
# Otherwise, the deployment will stop and CodeDeploy will consider the deployment
# to have failed to the Amazon EC2 instance. Make sure that the total number of seconds
# that are specified in "timeout" for all scripts in each individual deployment
# lifecycle event does not exceed a combined 3600 seconds (1 hour).
# For deployments to Amazon Linux, Ubuntu Server, or RHEL instances,
# you can specify "runas" in an event to
# run as the specified user. For more information, see the documentation.
# If you are deploying to Windows Server instances,
# remove "runas" altogether.
# If you do not want to run any commands during a particular deployment
# lifecycle event, remove that event declaration altogether. Blank or
# incomplete event declarations may cause associated deployments to fail.
# During the ApplicationStop deployment lifecycle event, run the commands
# in the script specified in "location" starting from the root of the
# revision's file bundle.
# During the BeforeInstall deployment lifecycle event, run the commands
# in the script specified in "location".
BeforeInstall:
- location: deploy/hooks/beforeinstall/initial_setup.sh
timeout: 300
runas: root
- location: deploy/hooks/beforeinstall/reload_ee_db.sh
timeout: 300
runas: root
- location: deploy/files/scripts/user_scripts/sync_baked_elections_parquet.sh
timeout: 300
runas: polling_stations
# During the AfterInstall deployment lifecycle event, run the commands
# in the script specified in "location".
AfterInstall:
- location: deploy/hooks/afterinstall/install_python_deps.sh
timeout: 300
runas: polling_stations
- location: deploy/hooks/afterinstall/write_envfile.py
timeout: 300
runas: polling_stations
- location: deploy/hooks/afterinstall/write_global_env_vars.py
timeout: 300
runas: root
- location: deploy/hooks/afterinstall/system_files.sh
timeout: 300
runas: root
- location: deploy/hooks/afterinstall/install_frontend_deps.sh
timeout: 300
runas: polling_stations
- location: deploy/hooks/afterinstall/collectstatic.sh
timeout: 300
runas: polling_stations
- location: deploy/hooks/afterinstall/compilemessages.sh
timeout: 300
runas: polling_stations
- location: deploy/hooks/afterinstall/createcachetable.sh
timeout: 300
runas: polling_stations
- location: deploy/hooks/afterinstall/install_crontab.sh
timeout: 300
runas: root
- location: deploy/hooks/afterinstall/migrate_rds.sh
timeout: 10800
runas: polling_stations
- location: deploy/hooks/afterinstall/ee_init_db.sh
timeout: 300
runas: polling_stations
- location: deploy/hooks/afterinstall/restart_ee.sh
timeout: 300
runas: root
- location: deploy/hooks/afterinstall/touchclean.sh
timeout: 300
runas: polling_stations
# During the ApplicationStart deployment lifecycle event, run the commands
# in the script specified in "location".
ApplicationStart:
- location: deploy/hooks/start_application.sh
timeout: 300
runas: root
# During the ValidateService deployment lifecycle event, run the commands
# in the script specified in "location".
ValidateService:
- location: deploy/hooks/validate_application.sh
timeout: 300
runas: root