by beneills · 10y ago · 0 comments
I've written the following instructions for updating the site (build new image, push to Docker Hub, pull into hyper.sh, stop previous container, run new one, attach floating IP). Does it seem reasonable?
HYPER_IP=209.177.92.197
LATEST_HASH=$(git log -1 --pretty=format:%h)
IMAGE_NAME=beneills/website:$LATEST_HASH
docker build -t $IMAGE_NAME .
docker push $IMAGE_NAME
hyper pull $IMAGE_NAME
hyper run -d -p 80 --name website $IMAGE_NAME
EXISTING_CONTAINER=$(hyper ps --filter name=website --quiet)
hyper stop $EXISTING_CONTAINER
hyper rm $EXISTING_CONTAINER
hyper run --size=s1 -d -p 80 --name website
beneills/website:2994001
hyper fip attach $HYPER_IP websiteLATEST_HASH=$(git rev-parse --short HEAD)
is the more normal way to do that.
It also looks like you'll have downtime due to deleting then running. Eww.
Could you drop a note on the forum [1] or join the slack [2] and ask there?