Skip to content
Snippets Groups Projects
Commit 4239d323 authored by Hordur Freyr Yngvason's avatar Hordur Freyr Yngvason :baby:
Browse files

Merge branch 'bugfix/passCredentials' into 'master'

fix: pass repo credentials when pulling chart

See merge request !205
parents eb443bbe 08884413
No related branches found
No related tags found
1 merge request!205fix: pass repo credentials when pulling chart
Pipeline #350415235 passed
......@@ -7,7 +7,7 @@ workflow:
variables:
DOCKER_DRIVER: overlay2
HELM_VERSION: 3.6.1
HELM_VERSION: 3.6.3
KUBERNETES_VERSION: 1.17.17
ALPINE_VERSION: '3.12'
GLIBC_VERSION: 2.31-r0
......
......@@ -81,7 +81,7 @@ test-download-chart-url:
# install a helm chart server and serve the local chart
- curl -LO https://s3.amazonaws.com/chartmuseum/release/latest/bin/linux/amd64/chartmuseum
- chmod +x ./chartmuseum
- ./chartmuseum --port=8080 --storage=local --storage-local-rootdir="./assets" &
- ./chartmuseum --port=8080 --storage=local --storage-local-rootdir="./assets" &
# instruct auto-deploy to use the chart server
- export AUTO_DEVOPS_CHART_REPOSITORY_NAME=chartmuseum
- export AUTO_DEVOPS_CHART_REPOSITORY=http://localhost:8080
......@@ -89,6 +89,24 @@ test-download-chart-url:
- auto-deploy download_chart
- ./test/verify-chart-version 2
test-download-protected-chart-url:
<<: *test-job
script:
# package the chart for the chart server
- (cd assets && helm package auto-deploy-app)
# install a helm chart server and serve the local chart
- curl -LO https://s3.amazonaws.com/chartmuseum/release/latest/bin/linux/amd64/chartmuseum
- chmod +x ./chartmuseum
- ./chartmuseum --port=8080 --storage=local --storage-local-rootdir="./assets" --basic-auth-user="user" --basic-auth-pass="pass" &
# instruct auto-deploy to use the chart server
- export AUTO_DEVOPS_CHART_REPOSITORY_NAME=chartmuseum
- export AUTO_DEVOPS_CHART_REPOSITORY=http://localhost:8080
- export AUTO_DEVOPS_CHART=chartmuseum/auto-deploy-app
- export AUTO_DEVOPS_CHART_REPOSITORY_USERNAME=user
- export AUTO_DEVOPS_CHART_REPOSITORY_PASSWORD=pass
- auto-deploy download_chart
- ./test/verify-chart-version 2
test-deploy-name:
<<: *test-job
variables:
......
......@@ -84,6 +84,12 @@ function add_custom_chart_repository() {
if [[ -n "$AUTO_DEVOPS_CHART_REPOSITORY_PASSWORD" ]]; then
helm_repo_auth+=('--password' "$AUTO_DEVOPS_CHART_REPOSITORY_PASSWORD")
fi
# Necessary when chart repo's index.yaml and the chart archives are in different domains
if [[ -n "$AUTO_DEVOPS_CHART_REPOSITORY_PASS_CREDENTIALS" ]]; then
helm_repo_auth+=('--pass-credentials')
fi
helm repo add \
"${AUTO_DEVOPS_CHART_REPOSITORY_NAME}" \
"${AUTO_DEVOPS_CHART_REPOSITORY}" \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment