@@ -83,6 +83,7 @@ mkdir -p $DEBIAN_CACHE_FOLDER
8383# ###############################################################################
8484# imports
8585# ###############################################################################
86+ # shellcheck disable=SC1090
8687. $SCRIPTPATH /../../../scripts/debian/reversion-helper.sh
8788
8889
@@ -188,7 +189,8 @@ function calculate_debian_version() {
188189 local __codename=$3
189190 local __network=$4
190191
191- local __network_suffix=$( get_suffix $__artifact $__network )
192+ local __network_suffix
193+ __network_suffix=$( get_suffix $__artifact $__network )
192194 echo " $__artifact :$__target_version -$__codename$__network_suffix "
193195}
194196
@@ -200,7 +202,8 @@ function calculate_docker_tag() {
200202 local __codename=$4
201203 local __network=$5
202204
203- local __network_suffix=$( get_suffix $__artifact $__network )
205+ local __network_suffix
206+ __network_suffix=$( get_suffix $__artifact $__network )
204207
205208 if [[ $__publish_to_docker_io == 1 ]]; then
206209 echo " $DOCKER_IO_REPO /$__artifact :$__target_version -$__codename$__network_suffix "
@@ -323,17 +326,21 @@ function get_cached_debian_or_download() {
323326 local codename=$3
324327 local network=$4
325328
326- local artifact_full_name=$( get_artifact_with_suffix " $artifact " " $network " )
327- local remote_path=" $( storage_root " $backend " ) /$BUILDKITE_BUILD_ID /debians/$codename /${artifact_full_name} _*"
328-
329- local check=$( storage_list " $backend " " $remote_path " )
329+ local artifact_full_name
330+ artifact_full_name=$( get_artifact_with_suffix " $artifact " " $network " )
331+ local remote_path
332+ remote_path=" $( storage_root " $backend " ) /$BUILDKITE_BUILD_ID /debians/$codename /${artifact_full_name} _*"
333+
334+ local check
335+ check=$( storage_list " $backend " " $remote_path " )
330336
331337 if [[ -z " $check " ]]; then
332338 echo -e " ❌ ${RED} !! No debian package found using $artifact_full_name . Are you sure ($BUILDKITE_BUILD_ID ) buildkite build is correct? Exiting.${CLEAR} \n"
333339 exit 1
334340 fi
335341
336- local target_hash=$( storage_md5 " $backend " " $remote_path " )
342+ local target_hash
343+ target_hash=$( storage_md5 " $backend " " $remote_path " )
337344
338345 mkdir -p " $DEBIAN_CACHE_FOLDER /$codename "
339346
@@ -362,7 +369,8 @@ function publish_debian() {
362369 local __debian_sign_key=${11}
363370
364371 get_cached_debian_or_download $__backend $__artifact $__codename " $__network "
365- local __artifact_full_name=$( get_artifact_with_suffix $__artifact $__network )
372+ local __artifact_full_name
373+ __artifact_full_name=$( get_artifact_with_suffix $__artifact $__network )
366374 local __deb=$DEBIAN_CACHE_FOLDER /$__codename /" ${__artifact_full_name} "
367375
368376 if [[ $__debian_sign_key != " " ]]; then
@@ -422,8 +430,8 @@ function promote_and_verify_docker() {
422430 local __publish_to_docker_io=$6
423431 local __verify=$7
424432 local __dry_run=$8
425-
426- local __network_suffix=$( get_suffix $__artifact $__network )
433+ local __network_suffix
434+ __network_suffix=$( get_suffix $__artifact $__network )
427435
428436 local __artifact_full_source_version=$__source_version -$__codename ${__network_suffix}
429437 local __artifact_full_target_version=$__target_version -$__codename ${__network_suffix}
@@ -489,23 +497,22 @@ function promote_debian() {
489497
490498 echo " 🍥 Promoting $__artifact debian from $__source_channel to $__target_channel , from $__source_version to $__target_version "
491499 echo " 📦 Target debian version: $( calculate_debian_version $__artifact $__target_version $__codename " $__network " ) "
500+
501+ local __artifact_full_name
502+ __artifact_full_name=$( get_artifact_with_suffix $__artifact $__network )
492503
493- local __artifact_full_name=$( get_artifact_with_suffix $__artifact $__network )
494504 local __deb=$DEBIAN_CACHE_FOLDER /$__codename /" ${__artifact_full_name} "
495505
496506 if [[ $__dry_run == 0 ]]; then
497507 echo " 🗃️ Promoting $__artifact debian from $__codename /$__source_version to $__codename /$__target_version "
498508 prefix_cmd " $SUBCOMMAND_TAB " $SCRIPTPATH /../../../scripts/debian/reversion.sh \
499509 --deb ${__artifact_full_name} \
500510 --version ${__source_version} \
501- --release ${__source_channel} \
502511 --new-version ${__target_version} \
503512 --suite ${__source_channel} \
504513 --repo ${__debian_repo} \
505514 --new-suite ${__target_channel} \
506- --new-name ${__artifact_full_name} \
507- --new-release ${__target_channel} \
508- --codename ${__codename}
515+ --new-name ${__artifact_full_name}
509516
510517 if [[ $__verify == 1 ]]; then
511518 echo " 📋 Verifying: $__artifact debian to $__target_channel channel with $__target_version version"
@@ -1237,8 +1244,9 @@ function verify(){
12371244 read -r -a __artifacts_arr <<< " $__artifacts"
12381245 read -r -a __networks_arr <<< " $__networks"
12391246 read -r -a __codenames_arr <<< " $__codenames"
1240-
1241- local __repo=$( get_repo $__docker_io )
1247+
1248+ local __repo
1249+ __repo=$( get_repo $__docker_io )
12421250
12431251 for artifact in " ${__artifacts_arr[@]} " ; do
12441252 for __codename in " ${__codenames_arr[@]} " ; do
@@ -1279,7 +1287,8 @@ function verify(){
12791287 fi
12801288
12811289 if [[ $__only_debians == 0 ]]; then
1282- local __artifact_full_name=$( get_artifact_with_suffix $artifact " " )
1290+ local __artifact_full_name
1291+ __artifact_full_name=$( get_artifact_with_suffix $artifact " " )
12831292
12841293 local __suffix_arg=" "
12851294 if [[ -n " $__docker_suffix " ]]; then
@@ -1300,12 +1309,14 @@ function verify(){
13001309 ;;
13011310 mina-rosetta)
13021311 for network in " ${__networks_arr[@]} " ; do
1303- local __artifact_full_name=$( get_artifact_with_suffix $artifact $network )
1312+ local __artifact_full_name
1313+ __artifact_full_name=$( get_artifact_with_suffix $artifact $network )
13041314
1305- local __docker_suffix_combined=$( combine_docker_suffixes " $network " " $__docker_suffix " )
1315+ local __docker_suffix_combined
1316+ __docker_suffix_combined=$( combine_docker_suffixes " $network " " $__docker_suffix " )
13061317
1318+ if [[ $__only_dockers == 0 ]]; then
13071319
1308- if [[ $__only_dockers == 0 ]]; then
13091320 echo " 📋 Verifying: $__artifact_full_name debian on $__channel channel with $__version version for $__codename codename"
13101321 echo " "
13111322
@@ -1338,10 +1349,14 @@ function verify(){
13381349 ;;
13391350 mina-daemon)
13401351 for network in " ${__networks_arr[@]} " ; do
1341- local __artifact_full_name= $( get_artifact_with_suffix $artifact $network )
1342- local __docker_suffix_combined =$( combine_docker_suffixes " $network " " $__docker_suffix " )
1352+ local __artifact_full_name
1353+ __artifact_full_name =$( get_artifact_with_suffix $artifact $network )
13431354
1344- if [[ $__only_dockers == 0 ]]; then
1355+ local __docker_suffix_combined
1356+ __docker_suffix_combined=$( combine_docker_suffixes " $network " " $__docker_suffix " )
1357+
1358+
1359+ if [[ $__only_dockers == 0 ]]; then
13451360 echo " 📋 Verifying: $__artifact_full_name debian on $__channel channel with $__version version for $__codename codename"
13461361 echo " "
13471362 prefix_cmd " $SUBCOMMAND_TAB " $SCRIPTPATH /../../../scripts/debian/verify.sh \
0 commit comments