-
Notifications
You must be signed in to change notification settings - Fork 109
/
circle.yml
68 lines (58 loc) · 1.87 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
version: 2.1
orbs:
snyk: snyk/[email protected]
jobs:
build-test-deploy:
docker:
- image: cimg/base:stable
working_directory: ~/Express-Starter
steps:
- checkout
- setup_remote_docker
- run:
name: Combat Preparation
command: |
docker-compose up -d app mongodb
# docker-compose exec -d app yarn serve
- run:
name: Compile Code
command: docker-compose exec app yarn build
- run:
name: Code Quality
command: docker-compose exec app yarn lint
- run:
name: Code Specification
command: |
docker-compose exec app yarn unit
docker-compose exec app yarn _codecov -t $CODECOV_TOKEN
- run:
name: E2E Specification
command: |
# docker-compose exec app yarn e2e
- run:
name: Deploy Application
command: >
if [ "${CIRCLE_BRANCH}" == "master" ]; then
echo "${HEROKU_TOKEN}" |
docker login -u "${HEROKU_USERNAME}" --password-stdin registry.heroku.com
APP_NAME=backend-starter-kit
docker build -f produce.Dockerfile
--build-arg index_name=${INDEX_NAME}
--build-arg secret_key=${SECRET_KEY}
--build-arg mongodb_uri=${MONGODB_URI}
--build-arg sentry_dsn=${SENTRY_DSN}
-t $APP_NAME .
docker tag $APP_NAME registry.heroku.com/$APP_NAME/web
docker push registry.heroku.com/$APP_NAME/web
docker-compose exec -e HEROKU_API_KEY=$HEROKU_TOKEN app
yarn _heroku container:release web -a $APP_NAME
fi
# - snyk/scan:
# docker-image-name: $APP_NAME
# fail-on-issues: false
# token-variable: $SNYK_TOKEN
workflows:
version: 2
workflow:
jobs:
- build-test-deploy