lets include git pushing into the ci system.

This commit is contained in:
kjeld Schouten-Lebbing
2022-03-29 21:07:40 +02:00
parent 86309fc750
commit 9132ac10d7
2 changed files with 40 additions and 51 deletions

View File

@@ -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"

View File

@@ -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 "$@"