diff --git a/.gitlab/.gitlab-ci.yaml b/.gitlab/.gitlab-ci.yaml new file mode 100644 index 00000000..99124f72 --- /dev/null +++ b/.gitlab/.gitlab-ci.yaml @@ -0,0 +1,41 @@ +stages: + - lint + - build + - test + - deploy + +variables: + CHANNEL: "stable" + CHARTS_DIR: "charts" + + BUILDX_VERSION: "v0.7.1" # https://github.com/docker/buildx/releases + BUILDX_ARCH: "linux-amd64" # I.E what architecture we are building FROM + BUILDX_TARGET_ARCHES: "linux/amd64,linux/arm64/v8" # what architecture we are building FOR + PAGES_DIR: "public" + +# REUSABLE CONDITIONAL RULES FOR PIPELINE TRIGGERS +.rules_default_branch_push: + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push" + +.rules_default_branch_tag: + rules: + - if: $CI_COMMIT_TAG + +.rules_nondefault_branch_push: + rules: + - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH && $CI_COMMIT_TAG == "" && $CI_PIPELINE_SOURCE == "push" + +helm-chart-lint: + stage: lint + image: + name: alpine/helm:latest + entrypoint: ["/bin/sh", "-c"] + script: + - | + for dir in ${CHARTS_DIR}/*/ + do + dir=${dir%*/} # removes trailing "/" + echo "linting ${dir} chart" + helm lint "${dir}"/ + done