Skip to content
Snippets Groups Projects
.gitlab-ci.yml 981 B
Newer Older
include:
  - project: 'sre/ci-building-blocks'
    ref: develop
    file:
      - '/gitlab-ci/base.yml'
      - '/gitlab-ci/publish-image.yml'
      - '/gitlab-ci/chart-image.yml'
richard.petersen's avatar
richard.petersen committed
stages:
  - build
build docker image:
  image: docker:latest
  script:
    - docker build --pull -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG} .
    - docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
    - docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}
  stage: build
  needs: []
  tags:
    - docker

upload Helm Chart:
  stage: build
  image: alpine/helm:3.2.4
  rules:
    - if: $CI_MERGE_REQUEST_ID
      when: never
    - if: '$CI_COMMIT_REF_SLUG =~ /(main|develop)/'
      changes:
        - helm/**/*
      when: on_success
  script:
    - apk add --update --no-cache curl
    - helm package helm/user-guide
    - curl --data-binary "@$(ls user-guide-*.tgz)" -s http://charts-chartmuseum.chartmuseum.svc.cluster.local:8080/api/charts
  tags:
    - kubernetes