#!/bin/bash set -euo pipefail VERSION="$1" REPO_URL="https://${GIT_USERNAME}:${GIT_PASSWORD}@gitea.fithwum.tech/fithwum/debian-base.git" git clone --depth=1 "$REPO_URL" upload-repo rm -rfv "upload-repo/$VERSION/*.tar.bz2" mkdir -p "upload-repo/$VERSION" cp "output/$VERSION/debian-$VERSION.tar.bz2" "upload-repo/$VERSION/" cd upload-repo sha256sum "$VERSION/debian-$VERSION.tar.bz2" > sha256sums.txt git config user.name "$GIT_USERNAME" git config user.email "ci@gitea.fithwum.tech" if git status --porcelain | grep .; then git add "$VERSION/*.tar.bz2" sha256sums.txt git commit -m "Update $VERSION archive" git push else echo "[INFO] No changes to commit." fi