Skip to content
Snippets Groups Projects
Commit 98f3a6e4 authored by Daniel Dehennin's avatar Daniel Dehennin
Browse files

feat(helm): publish the helm package

USAGE
=====

include:
  - project: EOLE/Infra/ci-tools
    ref: master
    file: /templates/Helm.yaml

stages:
  - release

helm publish: {extends: '.helm:push'}

REQUIREMENTS
============

- a `release` stage must be present in your pipeline or it must be
  overriden by the extending job to feet your need.

- the `.not-on-stable` rules templates or it must be overriden by
  the extending job to feet your need

- `HELM_REPO` variable: URL of the helm ChartMuseum

- `HELM_REPO_USERNAME` variable : name of the user with write access
  to the ChartMuseum

- `HELM_REPO_PASSWORD` variable: password of `HELM_REPO_USERNAME`

OPTIONAL VARIABLES
==================

- `CHART_DIR`: directory of the helm chart, default to `.`

- `HELM_IMAGE`: name of the `helm` docker image to use

- `HELM_ARGS`: optional arguments to pass to `helm cm-push` command,
  empty by default

- `HELM_BUILD_DIR`: write package chart in this directory, default
  to `build`
parent 115a62a8
No related tags found
3 merge requests!61Publish new release,!60Prepare new release,!56Resolve "Helm: provide CI templates to build and publish"
Pipeline #15840 passed
......@@ -7,6 +7,9 @@
#
# - `.helm:build`: build the helm package tgz file
#
# - `.helm:push`: push the helm package tgz file to a remote
# repository
#
---
#
# .helm:lint
......@@ -118,6 +121,71 @@
- echo -e "\e[0Ksection_end:$(date +%s):helm-package\r\e[0K"
#
# .helm:push
# ==========
#
# Push the helm package tgz file to a remote repository
#
# USAGE
# =====
#
# include:
# - project: EOLE/Infra/ci-tools
# ref: master
# file: /templates/Helm.yaml
#
# stages:
# - release
#
# helm publish: {extends: '.helm:push'}
#
# REQUIREMENTS
# ============
#
# - a `release` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need.
#
# - the `.not-on-stable` rules templates or it must be overriden by
# the extending job to feet your need
#
# - `HELM_REPO` variable: URL of the helm ChartMuseum
#
# - `HELM_REPO_USERNAME` variable: name of the user with write access
# to the ChartMuseum
#
# - `HELM_REPO_PASSWORD` variable: password of `HELM_REPO_USERNAME`
#
# OPTIONAL VARIABLES
# ==================
#
# - `CHART_DIR`: directory of the helm chart, default to `.`
#
# - `HELM_IMAGE`: name of the `helm` docker image to use
#
# - `HELM_ARGS`: optional arguments to pass to `helm cm-push` command,
# empty by default
#
# - `HELM_BUILD_DIR`: write package chart in this directory, default
# to `build`
#
# USED CI VARIABLES
# =================
#
.helm:push:
stage: release
extends:
- .helm:base
- .on-release-tag
script:
- echo -e "\e[0Ksection_start:$(date +%s):helm-cm-push-config[collapsed=true]\r\e[0KPrepare environment to push to helm remote repository '${HELM_REPO}'"
- helm repo add chartrepo "${HELM_REPO}"
- echo -e "\e[0Ksection_end:$(date +%s):helm-cm-push-config\r\e[0K"
- echo -e "\e[0Ksection_start:$(date +%s):helm-cm-push\r\e[0KExecute 'helm cm-push ${HELM_BUILD_DIR}/* chartrepo'"
- helm cm-push "${HELM_BUILD_DIR}"/* chartrepo
- echo -e "\e[0Ksection_end:$(date +%s):helm-cm-push\r\e[0K"
.helm:base:
extends: .not-on-stable
image:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment