-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
62 lines (55 loc) · 1.51 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
53
54
55
56
57
58
59
60
61
62
# This file is a template, and might need editing before it works on your project.
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:12
before_script:
- yarn || echo "yarn not found, this is expected if we are on the deploy steps"
cache:
paths:
- node_modules/
stages:
- checks
- build
- deploy
lint:
stage: checks
script:
- yarn run --silent lint
except:
- triggers
tests:
stage: checks
script:
- ./node_modules/.bin/nps test.coverage
except:
- triggers
build:
stage: build
variables:
ENV: staging
API_VERSION: latest
VERSION: $CI_COMMIT_REF_SLUG
artifacts:
paths:
- dist
expire_in: 1 week
script:
- ./node_modules/.bin/nps "build.config --env $ENV --version $VERSION --api-version $API_VERSION" "webpack.build --env.environment=$ENV" "build.manifest --env $ENV --version $VERSION"
except:
- tags
deploy in staging:
stage: deploy
image: registry.gitlab.com/arenaoftitans/aot-infra:latest
environment:
name: staging
url: https://dev.last-run.com/index-$CI_COMMIT_REF_SLUG.html
script:
- git clone https://gitlab.com/arenaoftitans/aot-infra.git /opt/aot-infra
- cd /opt/aot-infra
- mv /builds/arenaoftitans/arena-of-titans ./front
- ansible-playbook -i environments/staging front.yml -e version=$CI_COMMIT_REF_SLUG
- echo "Deployed to https://dev.last-run.com/index-$CI_COMMIT_REF_SLUG.html"
when: manual
except:
- tags
- triggers