Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ machine:

dependencies:
override:
- docker build -t kostyaurysov/sample-node .
- docker build -t kkhanda/sample-node .

test:
override:
- docker run kostyaurysov/sample-node npm test
- docker run kkhanda/sample-node npm test

deployment:
production:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- chmod +x deploy.sh
- sh ./deploy.sh
13 changes: 6 additions & 7 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash
docker build -t kostyaurysov/sample-node .
docker push kostyaurysov/sample-node
docker push kkhanda/sample-node

ssh deploy@35.187.30.81 << EOF
docker pull kostyaurysov/sample-node:latest
ssh kevin_khanda@35.195.193.222 << EOF
docker pull kkhanda/sample-node:latest
docker stop web || true
docker rm web || true
docker rmi kostyaurysov/sample-node:current || true
docker tag kostyaurysov/sample-node:latest kostyaurysov/sample-node:current
docker run -d --net app --restart always --name web -p 80:80 kostyaurysov/sample-node:current
docker rmi kkhanda/sample-node:current || true
docker tag kkhanda/sample-node:latest kkhanda/sample-node:current
docker run -d --restart always --name web -p 80:80 kkhanda/sample-node:current
EOF
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"nodemon": "^1.9.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 0"
"test": "echo \"Continuous integration and deployment lab finished\" && exit 0"
},
"keywords": [],
"author": "",
Expand Down