From 9132ac10d71f08e29da28fe2199fbd59ebca841e Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Tue, 29 Mar 2022 21:07:40 +0200 Subject: [PATCH] lets include git pushing into the ci system. --- .github/workflows/apps.release.yaml | 33 ---------------- tools/build-release.sh | 58 ++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 51 deletions(-) diff --git a/.github/workflows/apps.release.yaml b/.github/workflows/apps.release.yaml index e026c40a926..4528dc2b39c 100644 --- a/.github/workflows/apps.release.yaml +++ b/.github/workflows/apps.release.yaml @@ -48,39 +48,6 @@ jobs: env: CR_TOKEN: ${{ secrets.BOT_TOKEN }} - - name: Commit and Push new App releases - run: | - cd catalog - git config user.name "TrueCharts-Bot" - git config user.email "bot@truecharts.org" - git add --all - git commit -sm "Commit new App releases for TrueCharts" || exit 0 - git push - cd - - rm -rf catalog - - - name: Commit and Push new Chart releases - run: | - cd chartsrepo - git config user.name "TrueCharts-Bot" - git config user.email "bot@truecharts.org" - git add --all - git commit -sm "Commit new Chart releases for TrueCharts" || exit 0 - git push - cd - - rm -rf chartsrepo - - - name: Commit and Push new Docker-hub-locked App releases - run: | - cd dh_catalog - git config user.name "TrueCharts-Bot" - git config user.email "bot@truecharts.org" - git add --all - git commit -sm "Commit new App releases for TrueCharts" || exit 0 - git push - cd - - rm -rf dh_catalog - - name: Commit and Push new docs run: | git config user.name "TrueCharts-Bot" diff --git a/tools/build-release.sh b/tools/build-release.sh index fe366fca2ec..9694394c8f5 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -67,16 +67,11 @@ main() { gen_dh_cat release_charts update_index + upload_index fi - for chart in "${changed_charts[@]}"; do - if [[ -d "$chart" ]]; then - chartversion=$(cat ${chart}/Chart.yaml | grep "^version: " | awk -F" " '{ print $2 }') - chartname=$(basename ${chart}) - train=$(basename $(dirname "$chart")) - edit_release "$chart" "$chartname" "$train" "$chartversion" - fi - done validate_catalog + upload_catalog + upload_dhcatalog else echo "Nothing to do. No chart changes detected." fi @@ -375,16 +370,6 @@ pre_commit() { } export -f pre_commit -edit_release() { - local chart="$1" - local chartname="$2" - local train="$3" - local chartversion="$4" - # In here we can in the future add code to edit the release notes of the github releases - # For example: using the github API: https://docs.github.com/en/rest/reference/repos#update-a-release - } - export -f edit_release - create_changelog() { local chart="$1" local chartname="$2" @@ -562,6 +547,31 @@ validate_catalog() { } export -f validate_catalog +upload_catalog() { + cd catalog + git config user.name "TrueCharts-Bot" + git config user.email "bot@truecharts.org" + git add --all + git commit -sm "Commit new App releases for TrueCharts" || exit 0 + git push + cd - + rm -rf catalog +} +export -f upload_catalog + +upload_upload_dhcatalog() { + cd dh_catalog + git config user.name "TrueCharts-Bot" + git config user.email "bot@truecharts.org" + git add --all + git commit -sm "Commit new App releases for TrueCharts" || exit 0 + git push + cd - + rm -rf dh_catalog +} +export -f upload_dhcatalog + + parse_command_line() { while :; do @@ -733,4 +743,16 @@ update_index() { } export -f update_index +upload_index() { + cd chartsrepo + git config user.name "TrueCharts-Bot" + git config user.email "bot@truecharts.org" + git add --all + git commit -sm "Commit new Chart releases for TrueCharts" || exit 0 + git push + cd - + rm -rf chartsrepo +} +export -f upload_index + main "$@"