File tree 5 files changed +56
-0
lines changed
5 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ version : 0.0
2
+ os : linux
3
+
4
+ # In this case we copy all the files of the project to the EC2
5
+ files :
6
+ - source : /
7
+ destination : /home/ubuntu/api
8
+
9
+ # If a file already exists in the destination, it will be OVERWRITTEN
10
+ file_exists_behavior : OVERWRITE
11
+
12
+ #
13
+ hooks :
14
+ # First the CodeDeploy agent stops the application
15
+ ApplicationStop :
16
+ - location : scripts/application_stop.sh
17
+ timeout : 100
18
+ runas : ubuntu
19
+ overwrite : true
20
+ # The isntall the service (Copy the revision files to the EC2)
21
+ # So we can run after install scripts for example for configuration
22
+ AfterInstall :
23
+ - location : scripts/after_install.sh
24
+ timeout : 100
25
+ runas : ubuntu
26
+ overwrite : true
27
+ # Then Start the service
28
+ ApplicationStart :
29
+ - location : scripts/application_start.sh
30
+ timeout : 100
31
+ runas : ubuntu
32
+ overwrite : true
33
+ # Finally we validate the deployment with a script
34
+ ValidateService :
35
+ - location : scripts/validate_service.sh
36
+ timeout : 100
37
+ runas : ubuntu
38
+ overwrite : true
Original file line number Diff line number Diff line change
1
+ # !/bin/bash
2
+ cd /home/ubuntu/api
3
+
4
+ echo " Running After Start Script ..."
Original file line number Diff line number Diff line change
1
+ # !/bin/bash
2
+ cd /home/ubuntu/api
3
+
4
+ echo " Starting service ..."
5
+ docker compose up -d
Original file line number Diff line number Diff line change
1
+ # !/bin/bash
2
+ cd /home/ubuntu/api
3
+
4
+ echo " Stopping service ..."
5
+ docker compose down
Original file line number Diff line number Diff line change
1
+ # !/bin/bash
2
+ cd /home/ubuntu/api
3
+
4
+ echo " Validating service is Up ..."
You can’t perform that action at this time.
0 commit comments