.gitlab-ci.yml 847 Bytes
Newer Older
Nane Kratzke's avatar
Nane Kratzke 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
stages:
    - prepare
    - build
    - deploy
    - delete

secrets:
  stage: prepare
  script:
    - kubectl delete secret gitlab-registry-credentials || true
    - "kubectl create secret docker-registry gitlab-registry-credentials \
          --docker-server=$CI_REGISTRY \
          --docker-username=image-registry \ 
          --docker-password=$REGISTRY_READ_TOKEN \ 
      "

container:
  stage: prepare
  image:
      name: gcr.io/kaniko-project/executor:debug
      entrypoint: [""]
  only:
      changes:
      - .gitlab-ci.yml
      - api/*
      - api/*/*
  script:
      - mkdir -p /kaniko/.docker
      - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
Nane Kratzke's avatar
Nane Kratzke committed
30
      - /kaniko/executor --context api --destination $CI_REGISTRY_IMAGE/api:latest