Skip to content

Commit 069f667

Browse files
committed
push
1 parent bc3e035 commit 069f667

File tree

9 files changed

+32
-19
lines changed

9 files changed

+32
-19
lines changed

appspec.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ hooks:
77
ApplicationStop:
88
- location: deployment_scripts/stop_server.sh
99
timeout: 300
10-
runas: root
10+
runas: ubuntu
1111

1212
BeforeInstall:
1313
- location: deployment_scripts/before_install.sh
1414
timeout: 300
15-
runas: root
15+
runas: ubuntu
1616

1717
AfterInstall:
1818
- location: deployment_scripts/after_install.sh
1919
timeout: 300
20-
runas: root
20+
runas: ubuntu
2121

2222
ApplicationStart:
2323
- location: deployment_scripts/start_server.sh
2424
timeout: 300
25-
runas: root
25+
runas: ubuntu
2626

2727
ValidateService:
2828
- location: deployment_scripts/validate_service.sh
2929
timeout: 300
30-
runas: root
30+
runas: ubuntu
3131

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
#!/bin/bash
1+
#sudo !/bin/bash
22
cd /home/ubuntu/app
3-
npm install
3+
cp /home/root/app/index.js .
4+
cp /home/root/app/package.json .
5+
cp /home/root/app/package-lock.json .
6+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
7+
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
8+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
9+
nvm install v12
10+
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
11+
sudo node -v
12+
#sudo npm install pm2 -g
13+
#sudo pm2 list
14+
#sudo NODE_ENV=production pm2 start index.js -f
15+
#sudo pm2 status index.js
16+
#sudo pm2 list

deployment_scripts/before_install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#sudo !/bin/bash
22
FILE=/home/ubuntu/app/index.js
33
if test -f "$FILE"; then
44
echo "$FILE exists"
@@ -11,4 +11,4 @@ else
1111
fi
1212
cd /home/ubuntu/
1313
sudo rm -rf app
14-
sudo mkdir app
14+
sudo mkdir app

deployment_scripts/start_server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#!/bin/bash
1+
#sudo !/bin/bash
22
cd /home/ubuntu/app
3-
NODE_ENV=production pm2 start index.js -f
3+
sudo NODE_ENV=production pm2 start index.js -f

deployment_scripts/stop_server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#!/bin/bash
1+
#sudo !/bin/bash
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#sudo !/bin/bash
22

33
# Verify to see app working fine or not
4-
curl -v --silent localhost:3000/status 2>&1 | grep ok
4+
curl -v --silent localhost:3000/status 2>&1 | grep ok

docs/commands.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ sudo service codedeploy-agent status
2222

2323
# Deploy the files on S3
2424
```
25-
aws deploy push --application-name codeDeployDemoSandip --s3-location s3://devops-with-aws-sandip-youtube/codedeploydemo/app.zip --ignore-hidden-files --region us-west-2
25+
aws deploy push --application-name codeDeployDemo --s3-location s3://b/folder-name-inside-bucket/app.zip --ignore-hidden-files --region us-west-2

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "codedeploydemo",
2+
"name": "codedeploydemofolder ",
33
"version": "1.0.0",
44
"description": "To show how CodeDeploy Works",
55
"main": "index.js",
@@ -11,12 +11,12 @@
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "https://git-codecommit.us-west-2.amazonaws.com/v1/repos/codeDeployDemo"
14+
"url": "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/codeDeployDemo"
1515
},
1616
"keywords": [
1717
"node"
1818
],
19-
"author": "Sandip Das",
19+
"author": "Samiksha Sharma",
2020
"license": "ISC",
2121
"dependencies": {
2222
"config": "^3.3.3",

0 commit comments

Comments
 (0)