Skip to content

Commit

Permalink
Setup auto deployment via CircleCI #19
Browse files Browse the repository at this point in the history
  • Loading branch information
athlonUA committed Sep 5, 2018
1 parent a66e4b3 commit 5f018f0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
30 changes: 26 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
# List of jobs
jobs:
# The build and test job
build_and_test:
build-test:
working_directory: ~/angular-universal
docker:
- image: circleci/node:8.9.0-browsers
Expand Down Expand Up @@ -54,10 +54,32 @@ jobs:
- run:
name: Unit Testing
command: cd project/application && npm run test -- --watch=false
# The deploy job
deploy:
machine:
enabled: true
environment:
FINGERPRINT: 8c:c8:d3:84:56:47:d7:28:13:2a:d8:2b:4e:53:0e:c0
SSH_USER: la
SSH_HOST: angular-universal.lazy-ants.com
steps:
- add_ssh_keys:
fingerprints:
- "$FINGERPRINT" #https://circleci.com/docs/2.0/add-ssh-key
- run:
name: Deploy Over SSH
command: |
ssh $SSH_USER@$SSH_HOST "cd /var/www/angular-universal && bash deploy-circleci.sh"
workflows:
version: 2
# The build and test
build_and_test:
# The build, test and deploy
build-test_deploy:
jobs:
- build_and_test
- build-test
- deploy:
requires:
- build-test
filters:
branches:
only: master
9 changes: 9 additions & 0 deletions deploy-circleci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo 'Before checkout'
git status
git checkout -- .
echo 'After checkout'
git pull origin master
docker-compose up -d --build
docker exec -i angular-universal_nodejs npm install
docker exec -i angular-universal_nodejs bash -c 'npm run build:ssr'
docker exec -i angular-universal_nodejs bash -c 'npm run serve:ssr'
4 changes: 0 additions & 4 deletions deploy.sh

This file was deleted.

0 comments on commit 5f018f0

Please sign in to comment.