Skip to content

Commit

Permalink
Fix docker push script and mongo dump script (#7293)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo authored Dec 8, 2024
1 parent 7372798 commit 46d11af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions common/scripts/docker_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,43 @@ then
version="${a[0]}.${a[1]}.${c}-staging"
echo "Tagging staging $1 with version ${version}"
docker tag "$1:$rev_version" "$1:$version"
for n in {1..5}; do
for n in {1..25}; do
docker push "$1:$version" && break

if (( $n < 5 ))
if (( $n < 25 ))
then
echo 'Docker failed to push, wait 5 second'
sleep 5
else
echo '5 push attempts failed, exiting with failure'
echo '25 push attempts failed, exiting with failure'
exit 1
fi
done
else
echo "Tagging release $1 with version ${version}"
docker tag "$1:$rev_version" "$1:$version"
docker tag "$1:$rev_version" "$1:latest"
for n in {1..5}; do
for n in {1..25}; do
docker push "$1:$version" && break

if (( $n < 5 ))
if (( $n < 25 ))
then
echo 'Docker failed to push, wait 5 second'
sleep 5
else
echo '5 push attempts failed, exiting with failure'
echo '25 push attempts failed, exiting with failure'
exit 1
fi
done
for n in {1..5}; do
for n in {1..25}; do
docker push "$1:latest" && break

if (( $n < 5 ))
if (( $n < 25 ))
then
echo 'Docker failed to push, wait 5 second'
sleep 5
else
echo '5 push attempts failed, exiting with failure'
echo '25 push attempts failed, exiting with failure'
exit 1
fi
done
Expand Down
2 changes: 1 addition & 1 deletion common/scripts/docker_tag_push.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
echo "Tagging release $1 with version $2"
docker tag "$1" "$1:$2"
for n in {1..5}; do
for n in {1..25}; do
docker push "$1:$2" && break
echo 'Docker failed to push, wait 5 seconds'
sleep 5
Expand Down
2 changes: 1 addition & 1 deletion common/scripts/mongo_dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trap "exit" INT
mkdir -p ${dump}
mkdir -p ${dump}/workspaces

get_dbs="db.getSiblingDB('account').getCollection('workspace').find({lastVisit: {\$gt: Date.now() - ($DAYS * 24 * 60 * 60 * 1000)}}).forEach(it=>console.log(it.workspace, it.lastVisit))"
get_dbs="db.getSiblingDB('account').getCollection('workspace').find({ disabled: {\$ne:true}, mode: 'active', lastVisit: {\$gt: Date.now() - ($DAYS * 24 * 60 * 60 * 1000)}}).forEach(it=>console.log(it.workspace, it.lastVisit))"

mongosh --version
mongosh ${MONGO_URL} --eval "$get_dbs" > ${dump}/databases.list
Expand Down

0 comments on commit 46d11af

Please sign in to comment.