-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
84 lines (77 loc) · 2.27 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
# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest
services:
- docker:dind
stages:
# - build
- dockerize
- deploy
- deployProd
# buildBackend:
# stage: build
# image: maven:3.5.3-jdk-8
# artifacts:
# paths:
# - java/target/*.jar
# tags:
# - maastro
# script:
# - cd ./java && mvn clean package
# only:
# - master
# dockerizeBackend:
# stage: dockerize
# dependencies:
# - buildBackend
# tags:
# - maastro
# script:
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# - cp ./java/target/*.jar ./containers/backend/
# - cd ./containers/backend/ && docker build --pull -t "$CI_REGISTRY_IMAGE/backend:$CI_COMMIT_SHA" .
# - docker tag "$CI_REGISTRY_IMAGE/backend:$CI_COMMIT_SHA" "$CI_REGISTRY_IMAGE/backend:$CI_COMMIT_REF_SLUG"
# - docker push "$CI_REGISTRY_IMAGE/backend:$CI_COMMIT_SHA"
# - docker push "$CI_REGISTRY_IMAGE/backend:$CI_COMMIT_REF_SLUG"
# only:
# - master
dockerizeFrontend:
stage: dockerize
tags:
- maastro
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- cd ./containers/frontend/ && docker build --pull -t "$CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_SHA" .
- docker tag "$CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_SHA" "$CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_REF_SLUG"
- docker push "$CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_SHA"
- docker push "$CI_REGISTRY_IMAGE/frontend:$CI_COMMIT_REF_SLUG"
only:
- master
deployAcceptance:
stage: deploy
environment:
name: acceptance
url: https://acc.beslissamen.nl
tags:
- web-maastro-01
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# - bash run_scripts/acc/setup_base.sh
- bash run_scripts/acc/setup_application.sh $CI_COMMIT_SHA
only:
- master
deployProduction:
stage: deployProd
dependencies:
- deployAcceptance
when: manual
environment:
name: production
url: https://www.beslissamen.nl
tags:
- web-maastro-01
script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- bash run_scripts/prd/setup_application.sh $CI_COMMIT_SHA
only:
- master