.gitlab-ci.yml 1.39 KB
Newer Older
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
1
2
3
stages:
  - build
  - deploy
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
4
5
6
7
8
9
10
11
12
13

.kube-auth: &kube-auth
  before_script:
    - mkdir $HOME/.kube
    - touch $HOME/.kube/config
    - echo "$KUBE_CONFIG" >>  $HOME/.kube/config

.docker-login: &docker-login
  before_script:
    - echo -n $CI_REGISTRY_PASSWORD | docker login -u "$CI_REGISTRY_USER" --password-stdin  $CI_REGISTRY
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
14
#   - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
15

16
17
18
19
20
21
22
23
# cBioApp build:
#     stage: build
#     <<: *docker-login
#     image: docker:latest
#     script:
#         - docker build --pull -t "${CI_REGISTRY_IMAGE}:app${CI_COMMIT_SHA}" ./builds/cbioapp
#         - docker push "$CI_REGISTRY_IMAGE:app${CI_COMMIT_SHA}"
#     when: manual
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
24
25
26
27

cBioDb build:
    stage: build
    <<: *docker-login
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
28
    image: docker:latest
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
29
30
31
32
33
    script:
        - docker build --pull -t "${CI_REGISTRY_IMAGE}:db${CI_COMMIT_SHA}" ./builds/cbiodb
        - docker push "$CI_REGISTRY_IMAGE:db${CI_COMMIT_SHA}"
    when: manual

Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
34
cBioJob build:
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
35
    stage: build
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
36
    <<: *docker-login
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
37
    image: docker:latest
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
38
39
40
41
42
43
44
45
46
    script:
        - docker build --pull -t "${CI_REGISTRY_IMAGE}:job${CI_COMMIT_SHA}" ./builds/job
        - docker push "$CI_REGISTRY_IMAGE:job${CI_COMMIT_SHA}"
    when: manual


deploy to k8s:
    stage: deploy
    <<: *kube-auth
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
47
48
49
50
51
52
    image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
    script:
        - kubectl version
        - kubectl apply -f ./yaml
    when:
        manual