fix(ci): try to also fix catalog build process
This commit is contained in:
@@ -3,30 +3,6 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
chart_runner(){
|
|
||||||
if [[ -d "charts/${1}" ]]; then
|
|
||||||
echo "Start processing charts/${1} ..."
|
|
||||||
chartversion=$(cat charts/${1}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')
|
|
||||||
chartname=$(basename charts/${1})
|
|
||||||
train=$(basename $(dirname "charts/${1}"))
|
|
||||||
SCALESUPPORT=$(cat charts/${1}/Chart.yaml | yq '.annotations."truecharts.org/SCALE-support"' -r)
|
|
||||||
helm dependency update "charts/${1}" --skip-refresh || (sleep 10 && helm dependency update "charts/${1}" --skip-refresh) || (sleep 10 && helm dependency update "charts/${1}" --skip-refresh)
|
|
||||||
if [[ "${SCALESUPPORT}" == "true" ]]; then
|
|
||||||
clean_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
|
||||||
copy_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
|
||||||
patch_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
|
||||||
include_questions "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
|
||||||
clean_catalog "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
|
||||||
else
|
|
||||||
echo "Skipping chart charts/${1}, no correct SCALE compatibility layer detected"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Chart 'charts/${1}' no longer exists in repo. Skipping it..."
|
|
||||||
fi
|
|
||||||
echo "Done processing charts/${1} ..."
|
|
||||||
}
|
|
||||||
export -f chart_runner
|
|
||||||
|
|
||||||
include_questions(){
|
include_questions(){
|
||||||
local chart="$1"
|
local chart="$1"
|
||||||
local chartname="$2"
|
local chartname="$2"
|
||||||
@@ -185,16 +161,6 @@ clean_catalog() {
|
|||||||
}
|
}
|
||||||
export -f clean_catalog
|
export -f clean_catalog
|
||||||
|
|
||||||
gen_dh_cat() {
|
|
||||||
rm -rf dh_catalog/*.*
|
|
||||||
rm -rf dh_catalog/*
|
|
||||||
cp -rf catalog/* dh_catalog
|
|
||||||
cd dh_catalog
|
|
||||||
find ./ -type f -name *.yaml -exec sed -i 's/tccr.io/dh.tccr.io/gI' {} \;
|
|
||||||
cd -
|
|
||||||
}
|
|
||||||
export -f gen_dh_cat
|
|
||||||
|
|
||||||
prep_helm() {
|
prep_helm() {
|
||||||
if [[ -z "$standalone" ]]; then
|
if [[ -z "$standalone" ]]; then
|
||||||
helm repo add truecharts-old https://truecharts.org
|
helm repo add truecharts-old https://truecharts.org
|
||||||
@@ -261,7 +227,23 @@ copy_apps() {
|
|||||||
}
|
}
|
||||||
export -f copy_apps
|
export -f copy_apps
|
||||||
|
|
||||||
parthreads=$(($(nproc) * 2))
|
if [[ -d "charts/${1}" ]]; then
|
||||||
parallel -j ${parthreads} chart_runner '2>&1' ::: ${1[@]}
|
echo "Start processing charts/${1} ..."
|
||||||
echo "Starting post-processing"
|
chartversion=$(cat charts/${1}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }')
|
||||||
gen_dh_cat
|
chartname=$(basename charts/${1})
|
||||||
|
train=$(basename $(dirname "charts/${1}"))
|
||||||
|
SCALESUPPORT=$(cat charts/${1}/Chart.yaml | yq '.annotations."truecharts.org/SCALE-support"' -r)
|
||||||
|
helm dependency update "charts/${1}" --skip-refresh || (sleep 10 && helm dependency update "charts/${1}" --skip-refresh) || (sleep 10 && helm dependency update "charts/${1}" --skip-refresh)
|
||||||
|
if [[ "${SCALESUPPORT}" == "true" ]]; then
|
||||||
|
clean_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
|
copy_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
|
patch_apps "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
|
include_questions "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
|
clean_catalog "charts/${1}" "${chartname}" "$train" "${chartversion}"
|
||||||
|
else
|
||||||
|
echo "Skipping chart charts/${1}, no correct SCALE compatibility layer detected"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Chart 'charts/${1}' no longer exists in repo. Skipping it..."
|
||||||
|
fi
|
||||||
|
echo "Done processing charts/${1} ..."
|
||||||
|
|||||||
@@ -160,7 +160,21 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install yq
|
pip install yq
|
||||||
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
CHARTS=(${{ steps.collect-changes.outputs.modifiedChartsAfterTag }})
|
||||||
.github/scripts/build-catalog.sh ${CHARTS[@]}
|
parthreads=$(($(nproc) * 2))
|
||||||
|
parallel -j ${parthreads} .github/scripts/build-catalog.sh '2>&1' ::: ${CHARTS[@]}
|
||||||
|
|
||||||
|
|
||||||
|
- name: Generate docker-hub Catalog
|
||||||
|
shell: bash
|
||||||
|
if: |
|
||||||
|
steps.collect-changes.outputs.changesDetectedAfterTag == 'true'
|
||||||
|
run: |
|
||||||
|
rm -rf dh_catalog/*.*
|
||||||
|
rm -rf dh_catalog/*
|
||||||
|
cp -rf catalog/* dh_catalog
|
||||||
|
cd dh_catalog
|
||||||
|
find ./ -type f -name *.yaml -exec sed -i 's/tccr.io/dh.tccr.io/gI' {} \;
|
||||||
|
cd -
|
||||||
|
|
||||||
- name: Validate catalogs
|
- name: Validate catalogs
|
||||||
if: |
|
if: |
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ sources:
|
|||||||
- https://github.com/prometheus/mysqld_exporter
|
- https://github.com/prometheus/mysqld_exporter
|
||||||
- https://mariadb.org
|
- https://mariadb.org
|
||||||
type: application
|
type: application
|
||||||
version: 2.0.30
|
version: 2.0.31
|
||||||
annotations:
|
annotations:
|
||||||
truecharts.org/catagories: |
|
truecharts.org/catagories: |
|
||||||
- database
|
- database
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ sources:
|
|||||||
- https://github.com/bitnami/bitnami-docker-memcached
|
- https://github.com/bitnami/bitnami-docker-memcached
|
||||||
- http://memcached.org/
|
- http://memcached.org/
|
||||||
type: application
|
type: application
|
||||||
version: 2.0.32
|
version: 2.0.33
|
||||||
annotations:
|
annotations:
|
||||||
truecharts.org/catagories: |
|
truecharts.org/catagories: |
|
||||||
- database
|
- database
|
||||||
|
|||||||
Reference in New Issue
Block a user