.gitlab-ci.yml 2.38 KB
Newer Older
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
1
2
3
stages:
  - build
  - deploy
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
4

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
5
6
7
8
.kube-auth: &kube-auth 
  - mkdir $HOME/.kube
  - touch $HOME/.kube/config
  - echo "$KUBE_CONFIG" >>  $HOME/.kube/config
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
9

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
10

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
11
12
13
.docker-login: &docker-login
    - echo -n $CI_REGISTRY_PASSWORD | docker login -u "$CI_REGISTRY_USER" --password-stdin  $CI_REGISTRY

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
14
15
16
17
.docker-build-db:
  script: &docker-build-db
    - docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-db${CI_COMMIT_SHA}" ./builds/cbiodb
    - docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME}-db${CI_COMMIT_SHA}"
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
18

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
19
20
21
22
.docker-build-job:
  script: &docker-build-job
    - docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-job${CI_COMMIT_SHA}" ./builds/job
    - docker push "$CI_REGISTRY_IMAGE:${CI_COMMIT_REF_NAME}-job${CI_COMMIT_SHA}"
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
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


.cbio-db-build-template: &cbio-db-build-template
  stage: build
  image: docker:latest
  before_script:
    *docker-login
  script:
    *docker-build-db
  when: manual
  allow_failure: false

.cbio-job-build-template: &cbio-job-build-template
  stage: build
  image: docker:latest
  before_script: *docker-login
  script:
    *docker-build-job
  when: manual
  allow_failure: false

.deploy-to-k8s-template: &deploy-to-k8s-template
  stage: deploy
  before_script: 
    *kube-auth
  image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
  script:
      - ./yaml/bash.sh
      - kubectl version
      - kubectl apply -f ./yaml
  when:
      manual
  allow_failure: false
  
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
57
#PRODUCTION
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
58
cBioDb build:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
59
    <<: *cbio-db-build-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
60
    only:
Radim Peša's avatar
Radim Peša committed
61
      - master
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
62

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
63
cBioJob build:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
64
    <<: *cbio-job-build-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
65
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
66
      - master
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
67
68

deploy to k8s:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
69
70
    variables:
      NAMESPACE: cbio-on-demand
71
      DOMAIN: cbiood
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
72
73
      DATAHUB: datahub
    <<: *deploy-to-k8s-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
74
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
75
76
      - master
    
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
77
78

#BETA
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
79
cBioDb build beta:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
80
    <<: *cbio-db-build-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
81
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
82
83
      - beta

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
84
cBioJob build beta:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
85
    << : *cbio-job-build-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
86
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
87
      - beta
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
88

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
89
deploy to k8s beta:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
90
91
    variables:
      NAMESPACE: cbio-on-demand-beta
92
      DOMAIN: cbiood-beta
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
93
94
      DATAHUB: datahub-beta
    <<: *deploy-to-k8s-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
95
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
96
97
      - beta

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
98
#DEV
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
99
cBioDb build dev:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
100
    <<: *cbio-db-build-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
101
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
102
      - dev
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
103

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
104
cBioJob build dev:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
105
    <<: *cbio-job-build-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
106
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
107
      - dev
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
108

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
109
deploy to k8s dev:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
110
111
    variables:
      NAMESPACE: cbio-on-demand-dev
112
      DOMAIN: cbiood-dev
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
113
114
      DATAHUB: datahub-dev
    <<: *deploy-to-k8s-template
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
115
    only:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
116
      - dev