Skip to content

Commit

Permalink
Add missing containers for wipe mainnet 3
Browse files Browse the repository at this point in the history
  • Loading branch information
semeniak97mf committed Oct 28, 2024
1 parent f2eea6e commit e6d3d46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/mainnet-wipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /tmp
./wipe.sh
./wipe.sh cleanup.env
rm -f cleanup.env wipe.sh
wipe_validators:
Expand Down Expand Up @@ -150,7 +150,6 @@ jobs:
echo "container_process_exporter=process-exporter" >> stagenet/wipe/cleanup.env
echo "container_promtail=promtail" >> stagenet/wipe/cleanup.env
- name: Copy Files to Server
run: |
scp mainnet/wipe/cleanup.env ${{ secrets[matrix.user_key] }}@${{ secrets[matrix.host_key] }}:/tmp/cleanup.env
Expand All @@ -164,8 +163,8 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /tmp
./wipe.sh
# rm -f cleanup.env wipe.sh
./wipe.sh cleanup.env
rm -f cleanup.env wipe.sh
wipe_arch_nodes:

Expand Down Expand Up @@ -269,5 +268,5 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /tmp
./wipe.sh
./wipe.sh cleanup.env
rm -f cleanup.env wipe.sh
13 changes: 3 additions & 10 deletions mainnet/wipe/wipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,14 @@ source cleanup.env
: "${container_promtail:=}"

maybe_cleanup_containers() {

if [ -z "$(docker ps -aq -f name="$container_atleta")" ]; then
echo "Required container $container_atleta not found. Exiting..."
exit 1
fi

containers=("$container_atleta" "$container_process_exporter" "$container_promtail")

for container in "${containers[@]}"; do
if [ "$(docker ps -aq -f name="$container")" ]; then
if [ -n "$container" ] && [ "$(docker ps -aq -f name="$container")" ]; then
echo "Stopping and removing existing container $container..."
docker stop "$container"
docker rm "$container"
docker rm -f "$container" || echo "Failed to remove container $container"
else
echo "Container $container not found, skipping..."
echo "Container $container not found or name is empty, skipping..."
fi
done
}
Expand Down

0 comments on commit e6d3d46

Please sign in to comment.