enhance(scripts,packages.yml): sync upload steps

In commit ca2e7bcf73 ("ci(packages): Do not unconditionally publish
repo when no changes are made to other repos") the upload step to
fosshost was updated, but not the one for grimler.se.  Sync the upload
steps so that they are nearly identical again.
This commit is contained in:
Henrik Grimler 2022-10-30 15:17:33 +01:00
parent 5c4841e3a8
commit c004fd4514
No known key found for this signature in database
GPG Key ID: B0076E490B71616B
1 changed files with 26 additions and 24 deletions

View File

@ -261,7 +261,7 @@ jobs:
# Upload file to temporary directory. # Upload file to temporary directory.
uploaded_files=false uploaded_files=false
shopt -s nullglob shopt -s nullglob
if [ -f debs/built_${REPOSITORY_NAME}_packages.txt ]; then if [ -f debs/built_${REPOSITORY_NAME}_packages.txt ]; then
for filename in $(cat debs/built_${REPOSITORY_NAME}_packages.txt | sed -E 's/(..*)/debs\/\1_\*.deb debs\/\1-static_\*.deb/g'); do for filename in $(cat debs/built_${REPOSITORY_NAME}_packages.txt | sed -E 's/(..*)/debs\/\1_\*.deb debs\/\1-static_\*.deb/g'); do
if ! aptly_upload_file "$filename"; then if ! aptly_upload_file "$filename"; then
@ -299,7 +299,6 @@ jobs:
source scripts/aptly_api.sh source scripts/aptly_api.sh
for repo in $(jq --raw-output 'keys | .[]' repo.json); do for repo in $(jq --raw-output 'keys | .[]' repo.json); do
export REPOSITORY_NAME=$(jq --raw-output '.["'$repo'"].name' repo.json) export REPOSITORY_NAME=$(jq --raw-output '.["'$repo'"].name' repo.json)
export REPOSITORY_DISTRIBUTION=$(jq --raw-output '.["'$repo'"].distribution' repo.json) export REPOSITORY_DISTRIBUTION=$(jq --raw-output '.["'$repo'"].distribution' repo.json)
@ -307,28 +306,31 @@ jobs:
# Upload file to temporary directory. # Upload file to temporary directory.
uploaded_files=false uploaded_files=false
shopt -s nullglob shopt -s nullglob
for filename in $(cat debs/built_${REPOSITORY_NAME}_packages.txt | sed -E 's/(..*)/debs\/\1_\*.deb debs\/\1-static_\*.deb/g'); do
if ! aptly_upload_file "$filename"; then if [ -f debs/built_${REPOSITORY_NAME}_packages.txt ]; then
exit 1 for filename in $(cat debs/built_${REPOSITORY_NAME}_packages.txt | sed -E 's/(..*)/debs\/\1_\*.deb debs\/\1-static_\*.deb/g'); do
if ! aptly_upload_file "$filename"; then
exit 1
fi
uploaded_files=true
done
shopt -u nullglob
# Publishing repository changes.
if [ "$uploaded_files" = "true" ]; then
if ! aptly_add_to_repo; then
exit 1
fi
# Usually temporary directory is deleted automatically, but in certain cases it is left.
aptly_delete_dir
# grimler.se mirror is signed manually, can't publish
# through CI
# if ! aptly_publish_repo; then
# exit 1
# fi
fi fi
uploaded_files=true
done
shopt -u nullglob
# Publishing repository changes.
if [ "$uploaded_files" = "true" ]; then
if ! aptly_add_to_repo; then
exit 1
fi
# Usually temporary directory is deleted automatically, but in certain cases it is left.
aptly_delete_dir
# grimler.se mirror is signed manually, can't publish
# through CI
# if ! aptly_publish_repo; then
# exit 1
# fi
fi fi
done done