.gitlab-ci.yml 1.36 KB
Newer Older
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
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
stages: 
    - build
    - deploy

.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
   #- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY

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

cBioDb build:
    stage: build
    <<: *docker-login
    image docker:latest
    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

job build:
    stage: build
    <: *docker-login
    image docker:latest
    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
  image: registry.gitlab.ics.muni.cz:443/europdx/k8s/ci:latest
  script:
    - kubectl version
    - kubectl apply -f ./yaml
  when:
    manual