Skip to content
Snippets Groups Projects
Commit 1b2758d1 authored by Arie Peterson's avatar Arie Peterson
Browse files

Allow setting raw url for app tarballs

parent 688dd25b
No related branches found
No related tags found
1 merge request!557Resolve "Extend support for app pinning"
Pipeline #42036 passed with stages
in 7 minutes and 52 seconds
......@@ -99,10 +99,16 @@ data:
# Where to install the app
target_directory="/var/www/html/custom_apps"
# We need to edit $ to be able to use `tpl` inside a `range`,
# see https://github.com/helm/helm/issues/5979#issuecomment-518231758
# allows us to use version variable in the release_filename
# see https://github.com/helm/helm/issues/5979#issuecomment-518231758 .
# This allows us to use version variable in the `release_filename` or
# `raw_url`.
{{- $_ := set $ "version" .version}}
curl "https://github.com/{{ .github_repository }}/releases/download/{{ .version }}/{{ tpl .release_filename $ }}" -Lo "{{ .name }}.tar.gz"
{{- if .raw_url }}
url="{{ tpl .raw_url }}"
{{- else }}
url="https://github.com/{{ .github_repository }}/releases/download/{{ .version }}/{{ tpl .release_filename $ }}"
{{- end }} # end if .raw_url
curl "$url" -Lo "{{ .name }}.tar.gz"
# If the above url results in a 404, curl will not complain and store the
# body of the 404 in the file :/. So we check here whether we actually
# got a valid archive; `tar` will fail if not.
......
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