-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
46 lines (42 loc) · 1.06 KB
/
.gitlab-ci.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
stages:
- build
- deploy
app-test-and-build:
image: agoncaruks/nx-cli
stage: build
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
environment:
name: $ENV
cache:
paths:
- node_modules/
script:
- npm install --quiet
- npm run test $APP
- nx run $APP:build:$ENV
artifacts:
paths:
- dist/
client-deploy:
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "web" && $APP == "user-client"'
environment:
name: $ENV
script:
- aws s3 rm s3://wiseguy-client-$ENV --recursive
- aws s3 cp ./dist/apps/$APP s3://wiseguy-client-$ENV --recursive
api-deploy:
image: agoncaruks/aws-elastic-beanstalk-cli
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "web" && $APP == "user-api"'
before_script:
- git checkout $ENV
environment:
name: $ENV
script:
- python -m zipfile -c package.zip dist/apps/user-api/main.js dist/apps/user-api/package.json dist/apps/user-api/package-lock.json deploy/Procfile
- eb deploy WiseguyUserApi-$ENV