forked from DavidLDawes/EasyDEX-GUI
-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
52 lines (44 loc) · 1.22 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
46
47
48
49
50
51
52
stages:
- build
- deploy
- test
variables:
AGAMA_ARTIFACT: build.tar.gz
DOCKER_DRIVER: overlay2
build:
image: asherd/agama-builder
stage: build
script:
- cd react
- yarn install
- yarn run build
- tar -czf $AGAMA_ARTIFACT build
- mv build.tar.gz ..
artifacts:
paths:
- build.tar.gz
expire_in: 1 week
code_quality:
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [gl-code-quality-report.json]
deploy:
stage: deploy
image: google/cloud-sdk:alpine
dependencies:
- build
script:
- echo "$AUTH_KEY" > AUTH_KEY.json
- gcloud auth activate-service-account --key-file AUTH_KEY.json
- gsutil cp $AGAMA_ARTIFACT $STAGING/EasyDEX-GUI/$CI_COMMIT_REF_NAME/
- curl -X POST -F token=$CI_JOB_TOKEN --form ref=$CI_COMMIT_REF_NAME https://gitlab.com/api/v4/projects/10027007/trigger/pipeline