@@ -371,7 +371,10 @@ function publish_debian() {
371371 local __dry_run=$8
372372 local __backend=$9
373373 local __debian_repo=${10}
374- local __debian_sign_key=${11}
374+ local __arch=${11:- DEFAULT_ARCHITECTURE}
375+ local __force_upload_debians=${12:- 0}
376+ local __debian_sign_key=${13}
377+ local __new_artifact_name=${14:- " " }
375378
376379 get_cached_debian_or_download $__backend $__artifact $__codename " $__network "
377380 local __artifact_full_name
@@ -405,6 +408,7 @@ function publish_debian() {
405408 --names " $DEBIAN_CACHE_FOLDER /$__codename /${__artifact_full_name} _${__target_version} .deb" \
406409 --version $__target_version \
407410 --bucket $__debian_repo \
411+ " $( if [[ $__force_upload_debians == 1 ]]; then echo " --force" ; fi) " \
408412 -c $__codename \
409413 -r $__channel \
410414 ${__sign_arg[@]}
@@ -558,6 +562,8 @@ function publish_help(){
558562 printf " %-25s %s\n" " --backend" " [string] backend to use for storage. e.g gs,hetzner. default: gs" ;
559563 printf " %-25s %s\n" " --debian-repo" " [string] debian repository to publish to. default: $DEBIAN_REPO " ;
560564 printf " %-25s %s\n" " --debian-sign-key" " [string] debian signing key to use. default: lack of presence = no signing" ;
565+ printf " %-25s %s\n" " --strip-network-from-archive" " [bool] strip network from archive name. E.g mina-archive-devnet -> mina-archive" ;
566+ printf " %-25s %s\n" " --force-upload-debians" " [bool] force upload debian packages even if they exist already in the repository" ;
561567 echo " "
562568 echo " Example:"
563569 echo " "
@@ -588,6 +594,9 @@ function publish(){
588594 local __backend=" gs"
589595 local __debian_repo=$DEBIAN_REPO
590596 local __debian_sign_key=" "
597+ local __strip_network_from_archive=0
598+ local __arch=${DEFAULT_ARCHITECTURE}
599+ local __force_upload_debians=0
591600
592601 while [ ${# } -gt 0 ]; do
593602 error_message=" ❌ Error: a value is needed for '$1 '" ;
@@ -655,6 +664,18 @@ function publish(){
655664 __debian_sign_key=${2:? $error_message }
656665 shift 2;
657666 ;;
667+ --strip-network-from-archive )
668+ __strip_network_from_archive=1
669+ shift 1;
670+ ;;
671+ --arch )
672+ __arch=${2:? $error_message }
673+ shift 2;
674+ ;;
675+ --force-upload-debians )
676+ __force_upload_debians=1
677+ shift 1;
678+ ;;
658679 * )
659680 echo -e " ❌ ${RED} !! Unknown option: $1 ${CLEAR} \n" ;
660681 echo " " ;
@@ -700,6 +721,9 @@ function publish(){
700721 echo " - Backend: $__backend "
701722 echo " - Debian repo: $__debian_repo "
702723 echo " - Debian sign key: $__debian_sign_key "
724+ echo " - Strip network from archive: $__strip_network_from_archive "
725+ echo " - Architecture: $__arch "
726+ echo " - Force upload debians: $__force_upload_debians "
703727 echo " "
704728
705729 if [[ $__backend != " gs" && $__backend != " hetzner" && $__backend != " local" ]]; then
@@ -739,6 +763,8 @@ function publish(){
739763 $__dry_run \
740764 $__backend \
741765 $__debian_repo \
766+ " $__arch " \
767+ " $__force_upload_debians " \
742768 " $__debian_sign_key "
743769 fi
744770
@@ -749,6 +775,13 @@ function publish(){
749775 ;;
750776 mina-archive)
751777 for network in " ${__networks_arr[@]} " ; do
778+
779+ if [[ $__strip_network_from_archive == 1 ]]; then
780+ new_name=" mina-archive"
781+ else
782+ new_name=" "
783+ fi
784+
752785 if [[ $__only_dockers == 0 ]]; then
753786 publish_debian $artifact \
754787 $__codename \
@@ -760,7 +793,10 @@ function publish(){
760793 $__dry_run \
761794 $__backend \
762795 $__debian_repo \
763- " $__debian_sign_key "
796+ " $__arch " \
797+ " $__force_upload_debians " \
798+ " $__debian_sign_key " \
799+ " $new_name "
764800 fi
765801
766802 if [[ $__only_debians == 0 ]]; then
@@ -781,6 +817,8 @@ function publish(){
781817 $__dry_run \
782818 $__backend \
783819 $__debian_repo \
820+ " $__arch " \
821+ " $__force_upload_debians " \
784822 " $__debian_sign_key "
785823 fi
786824
@@ -802,6 +840,8 @@ function publish(){
802840 $__dry_run \
803841 $__backend \
804842 $__debian_repo \
843+ " $__arch " \
844+ " $__force_upload_debians " \
805845 " $__debian_sign_key "
806846 fi
807847
0 commit comments