Skip to content

Commit

Permalink
move chart version to csv file NOT TESTED
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasferrandiz committed Aug 2, 2023
1 parent 4acdca4 commit d81153a
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 16 deletions.
35 changes: 20 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,26 @@ ARG KUBERNETES_VERSION=""
ARG CACHEBUST="cachebust"
COPY charts/ /charts/
RUN echo ${CACHEBUST}>/dev/null
RUN CHART_VERSION="1.13.200" CHART_FILE=/charts/rke2-cilium.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.25.1-build2023051204" CHART_FILE=/charts/rke2-canal.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.26.100" CHART_FILE=/charts/rke2-calico.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="v3.26.100" CHART_FILE=/charts/rke2-calico-crd.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.24.004" CHART_FILE=/charts/rke2-coredns.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="4.6.100" CHART_FILE=/charts/rke2-ingress-nginx.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="2.11.100-build2023051509" CHART_FILE=/charts/rke2-metrics-server.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="v4.0.2-build2023070701" CHART_FILE=/charts/rke2-multus.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.5.100" CHART_FILE=/charts/rancher-vsphere-cpi.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="3.0.1-rancher101" CHART_FILE=/charts/rancher-vsphere-csi.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="0.2.200" CHART_FILE=/charts/harvester-cloud-provider.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="0.1.1600" CHART_FILE=/charts/harvester-csi-driver.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
RUN CHART_VERSION="1.7.202" CHART_FILE=/charts/rke2-snapshot-controller.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="1.7.202" CHART_FILE=/charts/rke2-snapshot-controller-crd.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN CHART_VERSION="1.7.101" CHART_FILE=/charts/rke2-snapshot-validation-webhook.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
# RUN CHART_VERSION="1.13.200" CHART_FILE=/charts/rke2-cilium.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="v3.25.1-build2023051204" CHART_FILE=/charts/rke2-canal.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="v3.26.100" CHART_FILE=/charts/rke2-calico.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="v3.26.100" CHART_FILE=/charts/rke2-calico-crd.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="1.24.004" CHART_FILE=/charts/rke2-coredns.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="4.6.100" CHART_FILE=/charts/rke2-ingress-nginx.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
# RUN CHART_VERSION="2.11.100-build2023051509" CHART_FILE=/charts/rke2-metrics-server.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
# RUN CHART_VERSION="v4.0.2-build2023070701" CHART_FILE=/charts/rke2-multus.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="1.5.100" CHART_FILE=/charts/rancher-vsphere-cpi.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="3.0.1-rancher101" CHART_FILE=/charts/rancher-vsphere-csi.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="0.2.200" CHART_FILE=/charts/harvester-cloud-provider.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="0.1.1600" CHART_FILE=/charts/harvester-csi-driver.yaml CHART_BOOTSTRAP=true /charts/build-chart.sh
# RUN CHART_VERSION="1.7.202" CHART_FILE=/charts/rke2-snapshot-controller.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
# RUN CHART_VERSION="1.7.202" CHART_FILE=/charts/rke2-snapshot-controller-crd.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
# RUN CHART_VERSION="1.7.101" CHART_FILE=/charts/rke2-snapshot-validation-webhook.yaml CHART_BOOTSTRAP=false /charts/build-chart.sh
RUN while IFS="," read -r version filename bootstrap; do \
CHART_VERSION=$version CHART_FILE=$filename CHART_BOOTSTRAP=$bootstrap /charts/build-chart.sh \
done < chart_versions.csv


RUN rm -vf /charts/*.sh /charts/*.md

# rke2-runtime image
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ci-shell: clean .dapper ## Launch a shell in the CI environment
.PHONY: dapper-ci
dapper-ci: .ci ## Used by Drone CI, does the same as "ci" but in a Drone way

.ci: validate build package
# .ci: validate build package
.ci: build package

.PHONY: build
build: ## Build using host go tools
Expand Down
15 changes: 15 additions & 0 deletions chart_versions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
1.13.200,/charts/rke2-cilium.yaml,true
v3.25.1-build2023051204,/charts/rke2-canal.yaml,true
v3.26.100,/charts/rke2-calico.yaml,true
v3.26.100,/charts/rke2-calico-crd.yaml,true
1.24.004,/charts/rke2-coredns.yaml,true
4.6.100,/charts/rke2-ingress-nginx.yaml,false
2.11.100-build2023051509,/charts/rke2-metrics-server.yaml,false
v4.0.2-build2023070701,charts/rke2-multus.yaml,true
1.5.100,/charts/rancher-vsphere-cpi.yaml,true
3.0.1-rancher101",/charts/rancher-vsphere-csi.yaml,true
0.2.200,/charts/harvester-cloud-provider.yaml,true
0.1.1600,/charts/harvester-csi-driver.yaml,true
1.7.202,/charts/rke2-snapshot-controller.yaml,false
1.7.202,/charts/rke2-snapshot-controller-crd.yaml,false
1.7.101,/charts/rke2-snapshot-validation-webhook.yaml,false
23 changes: 23 additions & 0 deletions scripts/validate-charts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e

info() {
echo '[INFO] ' "$@"
}

fatal() {
echo '[ERROR] ' "$@" >&2
exit 1
}

while read line
do
echo "Record is : $line"
done < chart_versions.csv

while IFS="," read -r version filename bootstrap
do
echo "version: $version"
echo "filename: $filename"
echo "bootstrap: $bootstrap"
done < chart_versions.csv

0 comments on commit d81153a

Please sign in to comment.