diff --git a/examples/authenticate-gcp.yml b/examples/authenticate-gcp.yml index 82b71eb..c548cdb 100644 --- a/examples/authenticate-gcp.yml +++ b/examples/authenticate-gcp.yml @@ -11,7 +11,7 @@ orbs: jobs: deploy-application: docker: - - image: entur/cci-toolbox:2.0 # This executor comes with a lof of pre-installed features; including gcloud. + - image: entur/cci-toolbox:2.1 # This executor comes with a lof of pre-installed features; including gcloud. steps: diff --git a/examples/install-helm-chart.yml b/examples/install-helm-chart.yml index 0af803f..1aa7105 100644 --- a/examples/install-helm-chart.yml +++ b/examples/install-helm-chart.yml @@ -11,7 +11,7 @@ orbs: jobs: deploy-application: docker: - - image: entur/cci-toolbox:2.0 # This executor comes with a lof of pre-installed features; including gcloud. + - image: entur/cci-toolbox:2.1 # This executor comes with a lof of pre-installed features; including gcloud. steps: diff --git a/src/commands/install-helm-chart.yml b/src/commands/install-helm-chart.yml index 7cd94ff..cb6967b 100644 --- a/src/commands/install-helm-chart.yml +++ b/src/commands/install-helm-chart.yml @@ -32,7 +32,11 @@ parameters: Whether to wait for the installation to be complete. Default true type: boolean default: true - + debug: + description: | + Run helm install with debug parameter. Default false + type: boolean + default: false #| ---- Authentication ---- |# gcp-service-key: description: | @@ -65,6 +69,7 @@ steps: NAMESPACE="<< parameters.namespace >>" VALUE_FILES="<< parameters.value-files >>" WAIT="<< parameters.wait >>" + DEBUG="<< parameters.debug >>" if [[ -n "${VALUE_FILES}" ]]; then SPLIT_VALUE_FILES=($(echo ${VALUE_FILES} | tr "," "\n")) for i in ${SPLIT_VALUE_FILES[@]} ; do @@ -78,4 +83,7 @@ steps: if [[ "${WAIT}" == "true" ]]; then set -- "$@" --wait fi + if [[ "${DEBUG}" == "true" ]]; then + set -- "$@" --debug + fi helm upgrade << parameters.release-name >> << parameters.chart >> "$@" --install diff --git a/src/commands/push-helm-chart-to-gcs.yml b/src/commands/push-helm-chart-to-gcs.yml index addcdcb..f859c61 100644 --- a/src/commands/push-helm-chart-to-gcs.yml +++ b/src/commands/push-helm-chart-to-gcs.yml @@ -6,6 +6,7 @@ description: | - Authenticate to Google Cloud Platform - Install the Helm client - Install the Helm GCS plugin + - Download dependencies from requirement.yaml file, if it exists - Pack the helm chart to a compressed file - Push to selected bucket @@ -29,11 +30,6 @@ parameters: Set the version on the chart to this semver version type: string default: "" - dependency-update: - description: | - Update dependencies from "requirements.yaml" before packaging - type: boolean - default: false #| ---- Helm GCS Plugin ---- |# gcs-plugin-version: @@ -85,7 +81,7 @@ steps: command: | APP_VERSION="<< parameters.app-version >>" VERSION="<< parameters.version >>" - DEPENDENCY_UPDATE=<< parameters.dependency-update >> + CHART_LOCATION="<< parameters.chart >>" if [ -n "${APP_VERSION}" ]; then set -- "$@" --app-version="${APP_VERSION}" @@ -95,11 +91,15 @@ steps: set -- "$@" --version="${VERSION}" fi - if [ ${DEPENDENCY_UPDATE} ]; then - set -- "$@" --dependency-update + if [ -f "${CHART_LOCATION}/requirements.yaml" ]; then + echo "Listing dependencies" + helm dependency list ${CHART_LOCATION} + echo "Updating dependencies" + helm dependency update ${CHART_LOCATION} + echo "Building dependencies" + helm dependency build ${CHART_LOCATION} fi - CHART_LOCATION="<< parameters.chart >>" mkdir -p build/helm echo "Packing chart from ${CHART_LOCATION} to build/helm." export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/account-auth.json