Skip to content

Commit

Permalink
Merge pull request #32 from paulcarlton-ww/debug
Browse files Browse the repository at this point in the history
add dependencies opt-in input
  • Loading branch information
stefanprodan authored Oct 6, 2022
2 parents b43a871 + 8456871 commit b97c7e3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Inputs:
* `chart_version` Explicitly specify chart version in package. If not defined then used chart values.
* `index_dir` The location of `index.yaml` file in the repo, defaults to the same value as `target_dir`
* `enterprise_url` The URL of enterprise github server in the format `<server-url>/<organisation>`
* `dependencies` A list of helm repositories required to verify dependencies in the format `<name>,<url>;<name>,<url>`

## Examples

Expand Down
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ inputs:
required: false
enterprise_url:
description: "The URL of enterprise github server in the format '<server-url>/<organisation>'"
required: false
required: false
dependencies:
description: "A list of helm repositories required to verify dependencies in the format '<name>,<url>;<name>,<url>'"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
Expand All @@ -71,3 +74,4 @@ runs:
- ${{ inputs.chart_version }}
- ${{ inputs.index_dir }}
- ${{ inputs.enterprise_url }}
- ${{ inputs.dependencies }}
11 changes: 11 additions & 0 deletions src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ APP_VERSION=${12}
CHART_VERSION=${13}
INDEX_DIR=${14}
ENTERPRISE_URL=${15}
DEPENDENCIES=${16}

CHARTS=()
CHARTS_TMP_DIR=$(mktemp -d)
Expand Down Expand Up @@ -93,6 +94,7 @@ main() {

locate
download
get_dependencies
dependencies
if [[ "$LINTING" != "off" ]]; then
lint
Expand Down Expand Up @@ -124,6 +126,15 @@ download() {
rm -rf $tmpDir
}

get_dependencies() {
IFS=';' read -ra dependency <<< "$DEPENDENCIES"
for repos in ${dependency[@]}; do
name=$(cut -f 1 -d, <<< "$repos")
url=$(cut -f 2 -d, <<< "$repos")
helm repo add ${name} ${url}
done
}

dependencies() {
for chart in ${CHARTS[@]}; do
helm dependency update "${chart}"
Expand Down

0 comments on commit b97c7e3

Please sign in to comment.