diff --git a/circle.yml b/circle.yml index b7e31c5..c300803 100644 --- a/circle.yml +++ b/circle.yml @@ -4,15 +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 - - ./deploy.sh + production: + branch: master + commands: + - docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS + - chmod +x deploy.sh + - sh ./deploy.sh diff --git a/deploy.sh b/deploy.sh old mode 100644 new mode 100755 index 7cd5f62..98829a5 --- a/deploy.sh +++ b/deploy.sh @@ -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 3000:3000 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 diff --git a/package.json b/package.json index 747eb46..c52dca0 100644 --- a/package.json +++ b/package.json @@ -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": "",