-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
107 lines (95 loc) · 2.73 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
image: docker:latest
variables:
# When using dind service we need to instruct docker, to talk with the
# daemon started inside of the service. The daemon is available with
# a network connection instead of the default /var/run/docker.sock socket.
#
# The 'docker' hostname is the alias of the service container as described at
# https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
#
# Note that if you're using Kubernetes executor, the variable should be set to
# tcp://localhost:2375 because of how Kubernetes executor connects services
# to the job container
DOCKER_HOST: tcp://docker:2375/
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
DOCKER_DRIVER: overlay2
services:
- docker:dind
stages:
- build
- test
- build images
- deploy
cache:
paths:
- frontend/osmybiz/node_modules/
backend-test:
image: python:3.6
stage: test
script:
- cd backend/api
- pip install -r requirements.txt
- flake8
- pytest
client-build:
image: node:8.4
stage: build
script:
- cd frontend/osmybiz
- npm install
- npm run build
client-unit:
image: node:8.4
stage: test
script:
- cd frontend/osmybiz
- npm install
- npm run unit
client-lint:
image: node:8.4
stage: test
script:
- cd frontend/osmybiz
- npm install
- npm run lint
build staging images:
image: geometalab/docker-builder
stage: build images
script:
- cd scripts
- export BUILD_VERSION=staging
- docker login -u $DOCKERHUB_LOGIN_USERNAME -p $DOCKERHUB_LOGIN_PASSWORD
- python3 build_and_push.py
only:
- develop
deploy to staging:
image: geometalab/docker-builder
stage: deploy
script:
- pip install --upgrade httpie
- http POST https://portainer.sifs0003.infs.ch/api/webhooks/4e1d0ac1-cb83-489b-9225-37ca33c08d97
- http POST https://portainer.sifs0003.infs.ch/api/webhooks/9f7b3e66-059a-4c72-8316-cc1e23159f1d
- http POST https://portainer.sifs0003.infs.ch/api/webhooks/fbe48238-332f-4c16-a06f-c79621ccc681
only:
- develop
build production images:
image: geometalab/docker-builder
stage: build images
script:
- cd scripts
- export BUILD_VERSION=production
- docker login -u $DOCKERHUB_LOGIN_USERNAME -p $DOCKERHUB_LOGIN_PASSWORD
- python3 build_and_push.py
only:
- master
deploy to production:
image: geometalab/docker-builder
stage: deploy
script:
- pip install --upgrade httpie
- http POST https://portainer.sifs0003.infs.ch/api/webhooks/529dd464-a134-4b3f-973e-7dd118095b74
- http POST https://portainer.sifs0003.infs.ch/api/webhooks/2a118e41-766c-452e-861c-fefd1a5a0ea2
- http POST https://portainer.sifs0003.infs.ch/api/webhooks/2d839778-ab8c-49cd-8b2d-78fc7cbf9720
only:
- master