Pillar Upgrade Script

Eugene de Fikh edited this page Apr 16, 2016 · 4 revisions
#!/usr/bin/env bash
set -e
IMAGE="coralproject/pillar"
CID=$(docker ps | grep $IMAGE | awk '{print $1}')
docker pull $IMAGE:latest

for im in $CID
do
LATEST=`docker inspect --format "{{.Id}}" $IMAGE`
RUNNING=`docker inspect --format "{{.Image}}" $im`
NAME=`docker inspect --format '{{.Name}}' $im | sed "s/\///g"`
echo "Latest:" $LATEST
echo "Running:" $RUNNING
if [ "$RUNNING" != "$LATEST" ];then
    echo "upgrading $NAME"
docker stop puppetserver
docker rm puppetserver
docker run -d \
  --name="pillar" \
  --restart="always" \
  --env-file /opt/pillar/env.cfg \
  -p 8080:8080 \
  $IMAGE
else
    echo "$NAME up to date"
fi 
done
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.