Skip to content

Commit

Permalink
Merge pull request #16190 from MinaProtocol/dkijania/port_limit_deb_p…
Browse files Browse the repository at this point in the history
…ublishing_attempts_to_dev

[Port][Dev] limiting correctly publishing deb attempts
  • Loading branch information
dkijania authored Oct 5, 2024
2 parents 2066601 + a3de8a1 commit 5aa0e2f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
6 changes: 2 additions & 4 deletions buildkite/src/Constants/DebianVersions.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ let minimalDirtyWhen =
, S.exactly "buildkite/src/Command/MinaArtifact" "dhall"
, S.strictlyStart (S.contains "buildkite/src/Jobs/Release/MinaArtifact")
, S.strictlyStart (S.contains "dockerfiles/stages")
, S.exactly "scripts/debian/build" "sh"
, S.exactly "scripts/debian/builder-helpers" "sh"
, S.exactly "scripts/docker/release" "sh"
, S.exactly "scripts/docker/build" "sh"
, S.strictlyStart (S.contains "scripts/debian")
, S.strictlyStart (S.contains "scripts/docker")
, S.exactly "buildkite/scripts/build-artifact" "sh"
, S.exactly "buildkite/scripts/build-hardfork-package" "sh"
, S.exactly "buildkite/scripts/check-compatibility" "sh"
Expand Down
35 changes: 24 additions & 11 deletions scripts/debian/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,37 @@ for _i in {1..10}; do (
"${DEB_NAMES}"
) && break || scripts/debian/clear-s3-lockfile.sh; done

# Verify integrity of debs on remote repo
function verify_o1test_repo_has_package {
sudo apt-get update
${DEBS3_SHOW} "${1}" "${DEB_VERSION}" ${ARCH} -c "${DEB_CODENAME}" -m "${DEB_RELEASE}"
return $?
}

for deb in $DEB_NAMES
do
echo "Adding packages.o1test.net ${DEB_CODENAME} ${DEB_RELEASE}"
sudo echo "deb [trusted=yes] http://packages.o1test.net ${DEB_CODENAME} ${DEB_RELEASE}" | sudo tee /etc/apt/sources.list.d/mina.list

DEBS3_SHOW="deb-s3 show $BUCKET_ARG $S3_REGION_ARG"

deb_split=("${deb//_/ }")
deb="${deb_split[0]}"
deb=$(basename "${deb}")
# extracting name from debian package path. E.g:
# _build/mina-archive_3.0.1-develop-a2a872a.deb -> mina-archive
deb=$(basename "$deb")
deb="${deb%_*}"

for i in {1..10}; do

sudo apt-get update
${DEBS3_SHOW} "$deb" "${DEB_VERSION}" "${ARCH}" -c "${DEB_CODENAME}" -m "${DEB_RELEASE}"
LAST_VERIFY_STATUS=$?

if [[ $LAST_VERIFY_STATUS == 0 ]]; then
echo "succesfully validated that package is uploaded to deb-s3"
break
fi

sleep 60
i=$((i+1))
done

for _i in {1..10}; do (verify_o1test_repo_has_package "${deb}") && break || sleep 60; done
if [[ $LAST_VERIFY_STATUS != 0 ]]; then
echo "Cannot locate '$deb' in debian repo. failing job..."
echo "You may still try to rerun job as debian repository is known from imperfect performance"
exit 1
fi

done

0 comments on commit 5aa0e2f

Please sign in to comment.