.gitlab-ci.yml 1.26 KB
Newer Older
Maarten de Waard's avatar
Maarten de Waard committed
1
include:
2
3
  - remote: https://open.greenhost.net/stackspin/stackspin/-/raw/host-chart-publish-defaults/.gitlab/ci_templates/helm_package.yml
  - template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
Maarten de Waard's avatar
Maarten de Waard committed
4
5
6
7

variables:
  CHART_NAME: local-path-provisioner
  CHART_DIR: deploy/chart
Maarten de Waard's avatar
Maarten de Waard committed
8
  KANIKO_BUILD_IMAGENAME: local-path-provisioner
9

10
stages:
11
  - build-project
12
  - build-container
13
14
15
16
  - lint-helm-chart
  - package-helm-chart
  - release-helm-chart

17
18
19
build-project:
  stage: build-project
  image:
20
    name: golang:1.17
21
22
23
  script:
    - ./scripts/build
  artifacts:
Maarten de Waard's avatar
Maarten de Waard committed
24
25
26
27
    paths:
      - ./bin/local-path-provisioner
    expire_in: 1 week
    when: always
28

29
30
31
32
33
34
35
36
37
build-container:
  stage: build-container
  image:
    # We need a shell to provide the registry credentials, so we need to use the
    # kaniko debug image (https://github.com/GoogleContainerTools/kaniko#debug-image)
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
38
    - /kaniko/executor --cache=true --context ${CI_PROJECT_DIR}/ --dockerfile ${CI_PROJECT_DIR}/package/Dockerfile --destination ${CI_REGISTRY_IMAGE}/${KANIKO_BUILD_IMAGENAME}:${CI_COMMIT_REF_NAME}