Skip to content

Commit

Permalink
Feature/add-deps (#10)
Browse files Browse the repository at this point in the history
* add dependency commands

* test dep feature in orb

* deploy with helm orb

* typo

* add deps update

* add deps update

* add deps update

* add debug mode

* add debug mode

* add debug mode

* add trigger dep update

* add trigger dep update

* added description

* remove spaces
  • Loading branch information
Pavloro authored and olereidar committed Oct 14, 2019
1 parent 103b95b commit fcb519f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/authenticate-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion examples/install-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion src/commands/install-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand All @@ -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
18 changes: 9 additions & 9 deletions src/commands/push-helm-chart-to-gcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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}"
Expand All @@ -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
Expand Down

0 comments on commit fcb519f

Please sign in to comment.