Skip to content

Commit

Permalink
Rework philbot start to avoid unnecessary subshell
Browse files Browse the repository at this point in the history
  • Loading branch information
plengauer authored May 21, 2024
1 parent 8181810 commit a74e22b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Deployment/Containerized/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: philbot-containerized
Provides: philbot-deployment
Version: 2.12.8
Version: 2.12.9
Architecture: all
Depends: bash, debconf, coreutils, util-linux, findutils, parallel, awk, grep, cron, wget, curl, philbot-config (>= 4.0.0), docker.io, iptables-persistent, jq, opentelemetry-shell (>= 3.16.0)
Conflicts: philbot-baremetal, philbot-k8s
Expand Down
6 changes: 3 additions & 3 deletions Deployment/Containerized/usr/bin/philbot_start
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ start() {
name=$1
image=$2
docker pull philipplengauer/philbot-$image:latest
if [ "$(docker ps --format '{{.Names}}' | grep philbot-$name)" ]; then
image_digest=$(docker image inspect --format='{{json .Id}}' "philipplengauer/philbot-$image:latest" | tr -d '"')
instance_digest=$(docker inspect --format='{{json .Image}}' philbot-$name | tr -d '"')
if [ docker ps --format '{{.Names}}' | grep -qE '^philbot-'"$name"'$' ]; then
image_digest="$(docker image inspect --format='{{json .Id}}' "philipplengauer/philbot-$image:latest" | tr -d '"')"
instance_digest="$(docker inspect --format='{{json .Image}}' philbot-"$name" | tr -d '"')"
if [ "$image_digest" = "$instance_digest" ]; then
return 0
fi
Expand Down

0 comments on commit a74e22b

Please sign in to comment.