|
|
|
@ -1,24 +1,30 @@ |
|
|
|
--- |
|
|
|
jobs: |
|
|
|
build: |
|
|
|
docker: |
|
|
|
- auth: |
|
|
|
- |
|
|
|
auth: |
|
|
|
password: $DOCKERHUB_PASSWORD |
|
|
|
username: xaela37 |
|
|
|
image: "cimg/node:14.15.0" |
|
|
|
steps: |
|
|
|
- checkout |
|
|
|
- run: "yarn install" |
|
|
|
- save_cache: |
|
|
|
- |
|
|
|
run: "yarn install" |
|
|
|
- |
|
|
|
save_cache: |
|
|
|
key: "npm-v1-dependencies-{{ checksum \"yarn.lock\" }}" |
|
|
|
paths: |
|
|
|
- node_modules |
|
|
|
end_to_end: |
|
|
|
docker: |
|
|
|
- auth: |
|
|
|
- |
|
|
|
auth: |
|
|
|
password: $DOCKERHUB_PASSWORD |
|
|
|
username: xaela37 |
|
|
|
image: "cimg/node:14.15.0" |
|
|
|
- auth: |
|
|
|
- |
|
|
|
auth: |
|
|
|
password: $DOCKERHUB_PASSWORD |
|
|
|
username: xaela37 |
|
|
|
environment: |
|
|
|
@ -28,85 +34,76 @@ jobs: |
|
|
|
image: "circleci/postgres:9.6.2-alpine" |
|
|
|
steps: |
|
|
|
- checkout |
|
|
|
- restore_cache: |
|
|
|
- |
|
|
|
restore_cache: |
|
|
|
keys: |
|
|
|
- "npm-v1-dependencies-{{ checksum \"yarn.lock\" }}" |
|
|
|
- run: |
|
|
|
- |
|
|
|
run: |
|
|
|
command: "yarn test:e2e" |
|
|
|
environment: |
|
|
|
DATABASE_URL: "postgres://pguser:pass@localhost:5432/pgdb" |
|
|
|
name: "yarn test" |
|
|
|
lint: |
|
|
|
docker: |
|
|
|
- auth: |
|
|
|
- |
|
|
|
auth: |
|
|
|
password: $DOCKERHUB_PASSWORD |
|
|
|
username: xaela37 |
|
|
|
image: "cimg/node:14.15.0" |
|
|
|
steps: |
|
|
|
- checkout |
|
|
|
- restore_cache: |
|
|
|
- |
|
|
|
restore_cache: |
|
|
|
key: "npm-v1-dependencies-{{ checksum \"yarn.lock\" }}" |
|
|
|
- run: |
|
|
|
- |
|
|
|
run: |
|
|
|
command: |- |
|
|
|
yarn lint |
|
|
|
yarn format:check |
|
|
|
name: "step lint" |
|
|
|
test_unit: |
|
|
|
docker: |
|
|
|
- auth: |
|
|
|
password: $DOCKERHUB_PASSWORD |
|
|
|
username: xaela37 |
|
|
|
image: "cimg/node:14.15.0" |
|
|
|
- auth: |
|
|
|
password: $DOCKERHUB_PASSWORD |
|
|
|
username: xaela37 |
|
|
|
environment: |
|
|
|
POSTGRES_DB: pgdb |
|
|
|
POSTGRES_PASSWORD: pass |
|
|
|
POSTGRES_USER: pguser |
|
|
|
image: "circleci/postgres:9.6.2-alpine" |
|
|
|
steps: |
|
|
|
- checkout |
|
|
|
- restore_cache: |
|
|
|
key: "npm-v1-dependencies-{{ checksum \"yarn.lock\" }}" |
|
|
|
- run: |
|
|
|
command: "yarn test" |
|
|
|
environment: |
|
|
|
DATABASE_URL: "postgres://psqluer:psqlpassword@localhost:5432/psqluer" |
|
|
|
heroku_deploy: |
|
|
|
docker: |
|
|
|
- image: buildpack-deps:trusty |
|
|
|
- |
|
|
|
image: "buildpack-deps:trusty" |
|
|
|
heroku_deploy: ~ |
|
|
|
steps: |
|
|
|
- checkout |
|
|
|
- run: |
|
|
|
name: Heroku Deploy |
|
|
|
command: git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:main |
|
|
|
- run: |
|
|
|
name: Smoke Test |
|
|
|
- |
|
|
|
run: |
|
|
|
command: "git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:main" |
|
|
|
name: "Heroku Deploy" |
|
|
|
- |
|
|
|
run: |
|
|
|
command: | |
|
|
|
HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/` |
|
|
|
if [ "$HTTPCODE" -ne 200 ];then |
|
|
|
echo "heroku app not responding, failing deploy" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/` |
|
|
|
if [ "$HTTPCODE" -ne 200 ];then |
|
|
|
echo "heroku app not responding, failing deploy" |
|
|
|
exit 1 |
|
|
|
fi |
|
|
|
name: "Smoke Test" |
|
|
|
version: 2 |
|
|
|
workflows: |
|
|
|
my_workflow: |
|
|
|
jobs: |
|
|
|
- build |
|
|
|
- test_unit: |
|
|
|
- |
|
|
|
test_unit: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- |
|
|
|
end_to_end: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- end_to_end: |
|
|
|
- |
|
|
|
lint: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- lint: |
|
|
|
- |
|
|
|
heroku_deploy: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- heroku_deploy: |
|
|
|
requires: |
|
|
|
- build |
|
|
|
- test_unit |
|
|
|
- end_to_end |
|
|
|
- lint |
|
|
|
- test_unit |
|
|
|
- end_to_end |
|
|
|
- lint |
|
|
|
version: 2 |