|
1 | 1 | NAME := tekton-dashboard
|
2 | 2 | CHART_DIR := charts/${NAME}
|
3 | 3 | CHART_VERSION ?= latest
|
| 4 | +RESOURCE_YAML := ${CHART_DIR}/templates/resource.yaml |
4 | 5 |
|
5 | 6 | CHART_REPO := gs://jenkinsxio/charts
|
6 | 7 |
|
7 | 8 | fetch:
|
8 | 9 | rm -f ${CHART_DIR}/templates/*.yaml
|
9 | 10 | mkdir -p ${CHART_DIR}/templates
|
10 | 11 | ifeq ($(CHART_VERSION),latest)
|
11 |
| - curl -sS https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml > ${CHART_DIR}/templates/resource.yaml |
| 12 | + curl -sS https://storage.googleapis.com/tekton-releases/dashboard/latest/release.yaml > ${RESOURCE_YAML} |
12 | 13 | else
|
13 |
| - curl -sS https://storage.googleapis.com/tekton-releases/dashboard/previous/v${CHART_VERSION}/release.yaml > ${CHART_DIR}/templates/resource.yaml |
| 14 | + curl -sS https://storage.googleapis.com/tekton-releases/dashboard/previous/v${CHART_VERSION}/release.yaml > ${RESOURCE_YAML} |
14 | 15 | endif
|
| 16 | + # Split and rename resource.yaml |
15 | 17 | jx gitops split -d ${CHART_DIR}/templates
|
16 | 18 | jx gitops rename -d ${CHART_DIR}/templates
|
17 |
| - # kustomize the resources to include some helm template blocs |
18 |
| - kustomize build ${CHART_DIR} | sed '/helmTemplateRemoveMe/d' > ${CHART_DIR}/templates/resource.yaml |
19 | 19 | # Remove namespace from metadata to force with helm install
|
20 | 20 | find $(CHART_DIR)/templates -type f -name "*.yaml" -exec yq -i eval 'del(.metadata.namespace)' "{}" \;
|
21 | 21 | # Amend subjects.namespace with release.namespace
|
22 | 22 | find . -type f \( -name "*-crb.yaml" -o -name "*-rb.yaml" \) -exec yq -i '(.subjects[] | select(has("namespace"))).namespace = "{{ .Release.Namespace }}"' "{}" \;
|
| 23 | + # Add dynamic external-logs container arg |
| 24 | + yq '.spec.template.spec.containers[0].args[] | split("=") | [.[0] | sub("^--","") , .[1] ] as $$item ireduce({}; .[$$item[0]] = $$item[1])' $(CHART_DIR)/templates/tekton-dashboard-deploy.yaml > args.yaml |
| 25 | + yq -i '.args = load("args.yaml")' $(CHART_DIR)/values.yaml |
| 26 | + # kustomize the resources to include some helm template blocs |
| 27 | + kustomize build ${CHART_DIR} | sed '/helmTemplateRemoveMe/d' > ${CHART_DIR}/templates/resource.yaml |
23 | 28 | jx gitops split -d ${CHART_DIR}/templates
|
24 | 29 | jx gitops rename -d ${CHART_DIR}/templates
|
| 30 | + # Remove temporary files |
| 31 | + rm -f ${RESOURCE_YAML} args.yaml |
| 32 | + # Copy src templates |
25 | 33 | cp src/templates/* ${CHART_DIR}/templates
|
26 | 34 | ifneq ($(CHART_VERSION),latest)
|
27 |
| - sed -i "s/^appVersion:.*/appVersion: ${CHART_VERSION}/" ${CHART_DIR}/Chart.yaml |
| 35 | + sed -i "" -e "s/^appVersion:.*/appVersion: ${CHART_VERSION}/" ${CHART_DIR}/Chart.yaml |
28 | 36 | endif
|
29 | 37 |
|
30 | 38 | build:
|
|
0 commit comments