Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
[ci] change workspace folder and checkout on each step
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhyde committed Feb 4, 2018
1 parent fd788b6 commit d2abfe3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ jobs:
setup:
docker:
- image: circleci/node:9
working_directory: ~/$CIRCLE_PROJECT_REPONAME
working_directory: ~/kotsu
steps:
- checkout
- attach_workspace:
at: ~/$CIRCLE_PROJECT_REPONAME
at: ~/kotsu
- run:
name: Checkout submodules
command: git submodule update --init --recursive
Expand All @@ -30,21 +30,21 @@ jobs:
test:
docker:
- image: circleci/node:9
working_directory: ~/$CIRCLE_PROJECT_REPONAME
steps:
- checkout
- attach_workspace:
at: ~/$CIRCLE_PROJECT_REPONAME
at: ~/kotsu
- run:
name: test
command: npm run test

build:
docker:
- image: circleci/node:9
working_directory: ~/$CIRCLE_PROJECT_REPONAME
steps:
- checkout
- attach_workspace:
at: ~/$CIRCLE_PROJECT_REPONAME
at: ~/kotsu
- run:
name: build
command: npm run build
Expand All @@ -54,20 +54,20 @@ jobs:

deploy:
machine: true
working_directory: ~/$CIRCLE_PROJECT_REPONAME
steps:
- checkout
- attach_workspace:
at: ~/$CIRCLE_PROJECT_REPONAME
at: ~/kotsu
- run:
name: Deploy if tests pass and branch is master
command: |
ssh-keyscan $SERVER_IP > ~/.ssh/known_hosts
cat dockerfile.template | envsubst > dockerfile
tar cvzf app.tgz dockerfile build/
scp app.tgz core@$SERVER_IP:~/$CIRCLE_PROJECT_REPONAME.tgz
scp app.tgz core@$SERVER_IP:~/kotsutgz
scp deploy.sh core@$SERVER_IP:~/deploy.sh
ssh core@$SERVER_IP chmod +x deploy.sh
ssh core@$SERVER_IP ./deploy.sh $CIRCLE_PROJECT_REPONAME $CIRCLE_SHA1
ssh core@$SERVER_IP ./deploy.sh kotsuCIRCLE_SHA1
workflows:
version: 2
Expand Down

0 comments on commit d2abfe3

Please sign in to comment.