-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
62 lines (54 loc) · 1.4 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
stages:
- build
- test
- review
- staging
- canary
- production
- cleanup
build:
stage: build
image: node:alpine
script:
- apk add --no-cache git
- npm install -g yarn lerna
- yarn run bootstrap
# lerna and yarn mess up node_modules/.bin.
# Delete this file, run yarn to restore .bin, then test.
- rm "node_modules/.yarn-integrity"
- yarn
- yarn run test
only:
- branches
codequality:
allow_failure: true
image: docker:git
services:
- name: registry.gitlab.frielforreal.com/global/docker:dind
alias: docker
script:
- setup_docker
- codeclimate
artifacts:
paths: [codeclimate.json]
# ---------------------------------------------------------------------------
.auto_devops: &auto_devops |
# Auto DevOps variables and functions
[[ "$TRACE" ]] && set -x
function codeclimate() {
cc_opts="--env CODECLIMATE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc"
docker run ${cc_opts} codeclimate/codeclimate init
docker run ${cc_opts} codeclimate/codeclimate analyze -f json > codeclimate.json
}
function setup_docker() {
if ! docker info &>/dev/null; then
if [ -z "$DOCKER_HOST" -a "$KUBERNETES_PORT" ]; then
export DOCKER_HOST='tcp://localhost:2375'
fi
fi
}
before_script:
- *auto_devops