1 changed files with 174 additions and 0 deletions
@ -1 +1,175 @@ |
|||
version: 2 |
|||
jobs: |
|||
build: |
|||
docker: |
|||
- image: circleci/node:dubnium-browsers |
|||
working_directory: ~/repo |
|||
steps: |
|||
- checkout |
|||
- restore_cache: |
|||
keys: |
|||
- dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|||
# fallback to using the latest cache if no exact match is found |
|||
- dependencies- |
|||
- run: yarn global add node-gyp && yarn install |
|||
- save_cache: |
|||
paths: |
|||
- node_modules |
|||
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|||
lint: |
|||
docker: |
|||
- image: circleci/node:dubnium-browsers |
|||
working_directory: ~/repo |
|||
steps: |
|||
- checkout |
|||
- restore_cache: |
|||
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|||
- run: yarn lint |
|||
- run: yarn format:check |
|||
server-doc-build: |
|||
docker: |
|||
- image: circleci/node:dubnium-browsers |
|||
working_directory: ~/repo |
|||
steps: |
|||
- checkout |
|||
- restore_cache: |
|||
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|||
- run: yarn doc:build |
|||
- run: |
|||
name: Copy deployment artifacts to workspace |
|||
command: | |
|||
cp doc-server/ /tmp/server-doc -r |
|||
- store_artifacts: |
|||
path: /tmp/server-doc |
|||
- persist_to_workspace: |
|||
root: /tmp |
|||
paths: |
|||
- server-doc |
|||
server-doc-deploy: |
|||
docker: |
|||
- image: circleci/node:dubnium-browsers |
|||
working_directory: ~/deploy-doc-server |
|||
steps: |
|||
- attach_workspace: |
|||
at: /tmp |
|||
- run: |
|||
name: Deploy app |
|||
command: npx netlify-cli deploy --prod --auth=MWN8GtUUWjdbSZEy7OiVKUq75W4Y9_d7-w7C-BIEHR8 --dir=/tmp/server-doc --site=50791863-0918-46c9-bc3e-2fba36790bba |
|||
back-test-unit: |
|||
docker: |
|||
- image: circleci/node:dubnium-browsers |
|||
working_directory: ~/repo |
|||
steps: |
|||
- checkout |
|||
- restore_cache: |
|||
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|||
- run: |
|||
command: yarn test:ci |
|||
environment: |
|||
DATABASE_URL: postgres://psqluer:psqlpassword@localhost:5432/psqluer |
|||
JWT_SECRET: aaaa |
|||
API_PORT: 3000 |
|||
API_HOST: localhost |
|||
API_PROTOCOL: http |
|||
- run: yarn add codecov && yarn codecov |
|||
back-test-e2e: |
|||
docker: |
|||
- image: circleci/node:dubnium-browsers |
|||
- image: circleci/postgres:9.6.5 |
|||
environment: |
|||
POSTGRES_DB: psqluer |
|||
POSTGRES_USER: psqluer |
|||
POSTGRES_PASSWORD: psqlpassword |
|||
working_directory: ~/repo |
|||
steps: |
|||
- checkout |
|||
- restore_cache: |
|||
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }} |
|||
- run: |
|||
command: yarn test:e2e |
|||
environment: |
|||
DATABASE_URL: postgres://psqluer:psqlpassword@localhost:5432/psqluer |
|||
JWT_SECRET: aaaa |
|||
API_PORT: 3000 |
|||
API_HOST: localhost |
|||
API_PROTOCOL: http |
|||
|
|||
#docker-build-and-push: |
|||
# working_directory: /dockerapp |
|||
#docker: |
|||
# - image: docker:17.05.0-ce-git |
|||
#steps: |
|||
# - checkout |
|||
# - setup_remote_docker |
|||
# - run: |
|||
# name: Build application Docker image |
|||
# command: | |
|||
# docker build --cache-from=app -t app . |
|||
# - deploy: |
|||
# name: Publish application to docker hub |
|||
# command: | |
|||
# docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD |
|||
# docker tag app $DOCKER_HUB_USER_ID/my-awesome-ci-expr:$CIRCLE_BUILD_NUM |
|||
# docker tag app $DOCKER_HUB_USER_ID/my-awesome-ci-expr:latest |
|||
# docker push $DOCKER_HUB_USER_ID/my-awesome-ci-expr:$CIRCLE_BUILD_NUM |
|||
# docker push $DOCKER_HUB_USER_ID/my-awesome-ci-expr:latest |
|||
|
|||
back-deploy-heroku: |
|||
docker: |
|||
- image: buildpack-deps:trusty |
|||
steps: |
|||
- checkout |
|||
- run: |
|||
name: Heroku Deploy |
|||
command: git push https://heroku:9df2d0c0-9bc3-4469-b9f2-8cb3f0702d42@git.heroku.com/salty-journey-63595.git HEAD:master |
|||
- run: |
|||
name: Smoke Test |
|||
command: bash ./test.sh |
|||
|
|||
workflows: |
|||
version: 2 |
|||
build-test-and-lint: |
|||
jobs: |
|||
- build |
|||
- back-test-unit: |
|||
requires: |
|||
- build |
|||
- back-test-e2e: |
|||
requires: |
|||
- build |
|||
- lint: |
|||
requires: |
|||
- build |
|||
#- docker-build-and-push: |
|||
# requires: |
|||
# - build |
|||
# - lint |
|||
# - back-test-e2e |
|||
# - back-test-unit |
|||
#filters: |
|||
# branches: |
|||
# only: main |
|||
- back-deploy-heroku: |
|||
requires: |
|||
- build |
|||
- lint |
|||
- back-test-e2e |
|||
- back-test-unit |
|||
filters: |
|||
branches: |
|||
only: main |
|||
- server-doc-build: |
|||
requires: |
|||
- build |
|||
- lint |
|||
- back-test-e2e |
|||
- back-test-unit |
|||
filters: |
|||
branches: |
|||
only: main |
|||
- server-doc-deploy: |
|||
requires: |
|||
- server-doc-build |
|||
filters: |
|||
branches: |
|||
only: main |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue