Commit cded3c1b authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason
Browse files

Merge branch 'allow-override-url-bitnami-chart' into 'master'

feat: Allow override bitnami chart repository URL

See merge request gitlab-org/cluster-integration/auto-deploy-image!278
parents 05edcbcf f7d35e93
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -115,6 +115,23 @@ test-download-protected-chart-url:
    - auto-deploy download_chart
    - ./test/verify-chart-version 2

test-default-postgres-chart:
  <<: *test-job
  variables:
    POSTGRES_ENABLED: "true"
  script:
    - auto-deploy download_chart
    - (helm repo ls | grep -q 'https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami') || exit 1

test-override-postgres-chart:
  <<: *test-job
  variables:
    POSTGRES_ENABLED: "true"
    POSTGRES_CHART_REPOSITORY: https://charts.bitnami.com/bitnami
  script:
    - auto-deploy download_chart
    - (helm repo ls | grep -q https://charts.bitnami.com/bitnami) || exit 1

test-deploy-name:
  <<: *test-job
  variables:
+6 −3
Original line number Diff line number Diff line
@@ -6,8 +6,12 @@ set -e

export AUTO_DEPLOY_ENVIRONMENT_VALUES_FILE=/tmp/auto-deploy-environment-values.yaml
export RELEASE_NAME=${HELM_RELEASE_NAME:-$CI_ENVIRONMENT_SLUG}
# See https://github.com/bitnami/charts/issues/10545
export DEFAULT_BITNAMI_REPOSITORY="https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami"
export POSTGRESQL_RELEASE_NAME="${RELEASE_NAME}-postgresql"
export POSTGRES_VERSION="${POSTGRES_VERSION:-"9.6.16"}"
export POSTGRES_CHART_REPOSITORY=${POSTGRES_CHART_REPOSITORY:-$DEFAULT_BITNAMI_REPOSITORY}
export POSTGRES_CHART_VERSION="${POSTGRES_CHART_VERSION:-"8.2.1"}"
export ASSETS_DIR='/assets'
export ASSETS_CHART_DIR="${ASSETS_DIR}/auto-deploy-app"
export ROLLOUT_RESOURCE_TYPE="${ROLLOUT_RESOURCE_TYPE:-deployment}"
@@ -77,8 +81,7 @@ function add_chart_repositories() {
  helm repo add stable https://charts.helm.sh/stable
  # bitnami repository is used for in-cluster PostgreSQL installation.
  if [[ "$POSTGRES_ENABLED" == "true" ]]; then
    # See https://github.com/bitnami/charts/issues/10545
    helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
    helm repo add bitnami "$POSTGRES_CHART_REPOSITORY"
  fi
  # Additionaly, users can specify their custom chart repository.
  add_custom_chart_repository
@@ -190,7 +193,7 @@ function install_postgresql() {
    "${atomic_flag[@]}" \
    "${debug_flag[@]}" \
    --wait \
    --version 8.2.1 \
    --version "$POSTGRES_CHART_VERSION" \
    --set fullnameOverride="$name" \
    --set postgresqlUsername="$POSTGRES_USER" \
    --set postgresqlPassword="$POSTGRES_PASSWORD" \