Skip to content

Commit 6d419ea

Browse files
authored
Merge pull request #6 from BetterStackHQ/dk/swarm-pull-always
Add `--pull always` to swarm setup script
2 parents 3217048 + 32d0424 commit 6d419ea

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

deploy-to-swarm.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if [[ $EXIT_CODE -ne 0 ]]; then
6666
print_blue "Please make sure '$SSH_CMD $MANAGER_NODE' works on this machine and $MANAGER_NODE is a swarm manager."
6767
echo
6868
print_blue "Need to use different SSH user or command?"
69-
echo "Customize SSH user and command:"
69+
echo "Customize SSH user and command:"
7070
echo " curl -sSL ... | MANAGER_NODE=\"root@host\" SSH_CMD=\"tsh ssh\" COLLECTOR_SECRET=\"...\" bash"
7171
echo
7272
exit 1
@@ -89,22 +89,22 @@ CURRENT=0
8989
for NODE in $NODES; do
9090
((CURRENT++))
9191
print_blue "Deploying to node: $NODE ($CURRENT/$NODE_COUNT)"
92-
92+
9393
# Extract user from MANAGER_NODE if present
9494
if [[ "$MANAGER_NODE" == *"@"* ]]; then
9595
SSH_USER="${MANAGER_NODE%%@*}"
9696
NODE_TARGET="${SSH_USER}@${NODE}"
9797
else
9898
NODE_TARGET="$NODE"
9999
fi
100-
100+
101101
if $SSH_CMD "$NODE_TARGET" /bin/bash <<EOF
102102
set -e
103103
echo "Running: docker compose up..."
104104
curl -sSL https://raw.githubusercontent.com/BetterStackHQ/collector/main/docker-compose.yml | \\
105105
COLLECTOR_SECRET="$COLLECTOR_SECRET" HOSTNAME=\$(hostname) \\
106-
docker compose -f - up -d
107-
106+
docker compose -f - up -d --pull always
107+
108108
echo "Checking deployment status..."
109109
docker ps --filter "name=better-stack" --format "table {{.Names}}\t{{.Status}}"
110110
EOF
@@ -115,7 +115,7 @@ EOF
115115
exit 1
116116
fi
117117
echo
118-
118+
119119
done
120120

121-
print_green "✓ Better Stack collector successfully deployed to all swarm nodes!"
121+
print_green "✓ Better Stack collector successfully deployed to all swarm nodes!"

0 commit comments

Comments
 (0)