-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
59 lines (53 loc) · 1.38 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
image: node:latest
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
services:
- name: mongo:latest
alias: database
stages:
# - Test
- Build
# Test:
# stage: Test
# image: node:lts
# before_script:
# - "npm config set loglevel warn"
# - "npm run setup"
# - "npm install"
# script:
# - npm run test
# cache:
# paths:
# - node_modules/
Staging Build:
stage: Build
image: docker:stable
services:
- docker:18-dind
before_script:
- "docker login registry.mira.systems -u ${DOCKER_USER} -p ${DOCKER_PASS}"
script:
- "docker build -t registry.mira.systems/farmlab/mqtt-api:staging-latest -t registry.mira.systems/farmlab/mqtt-api:dev-${CI_COMMIT_SHORT_SHA} ."
- "docker push registry.mira.systems/farmlab/mqtt-api:staging-latest"
- "docker push registry.mira.systems/farmlab/mqtt-api:dev-${CI_COMMIT_SHORT_SHA}"
after_script:
- docker logout registry.mira.systems
when: manual
except:
- master
Production Build:
stage: Build
image: docker:stable
services:
- docker:18-dind
before_script:
- "docker login registry.mira.systems -u ${DOCKER_USER} -p ${DOCKER_PASS}"
script:
- "docker build -t registry.mira.systems/farmlab/mqtt-api:latest ."
- "docker push registry.mira.systems/farmlab/mqtt-api:latest"
after_script:
- docker logout registry.mira.systems
only:
- master