-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathnew 15.txt
More file actions
96 lines (69 loc) · 1.99 KB
/
new 15.txt
File metadata and controls
96 lines (69 loc) · 1.99 KB
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
Based on m5
Step 1
------
Create ec2 instance
"pick ubuntu"
use this as the developer environment
open ports
22
8080
80
Step 2
------
Create role - say "ec2cicdrole"
ec2 role (all ec2 instances to call aws services)
Give
AWSCodeCommitFullAccess
AWSCodeDeployFullAccess
AWSCodePipelineFullAccess
Cloudwatchfullaccess
AmazonS3FullAccess (artifact is stored in s3)
Attach this role to the ec2 instance
ec2 instance -> Actions -> "Instance Settings" -> Attach/Replace IAM Role
Step 3
------
login to ubuntu box.
sudo apt update
sudo apt upgrade
sudo apt install awscli
aws configure
To use /opt as the base directroy
sudo chown ubuntu:ubuntu -R /opt
CodeCommit commands
-------------------
Codebase synch commands
mkdir /opt/temp
cd /opt/temp
To be executed on your local laptop
scp -i your.pem HelloWorld-CodeBase.tar.gz ubuntu@PUBLIC-IP:/opt/temp
tar -zxf HelloWorld-CodeBase.tar.gz
cd HelloWorld
rm -rf .git
rsync -r /opt/temp/HelloWorld/ /opt/helloworld
cd /opt/helloworld
rm -rf /opt/temp
Git commands
cd /opt/helloworld
git add .
git status
git commit -a -m “First commit”
git push origin master
CodeDeploy commands
---------------------
CodeDeploy agent installation (Prod EC2 instance)
sudo chown ubuntu:ubuntu -R /opt
cd /opt
sudo apt install ruby -y
cd /opt
Execute any one command (demonstrating two possible options)
wget https://aws-codedeploy-us-west-2.s3.amazonaws.com/latest/install (Links to an external site.)Links to an external site.
wget https://aws-codedeploy-us-west-2.s3.us-west-2.amazonaws.com/latest/install (Links to an external site.)Links to an external site.
chmod +x ./install
sudo ./install auto
After installation steps
Stop and start (multiple times) and then you will see the service running
sudo service codedeploy-agent status
sudo service codedeploy-agent stop
sudo service codedeploy-agent start
Agent logs
tail -30 /var/log/aws/codedeploy-agent/codedeploy-agent.log