Skip to content

Instantly share code, notes, and snippets.

@ghostbar
Created February 4, 2016 21:41
Show Gist options
  • Save ghostbar/ded530c54b9e3ff99012 to your computer and use it in GitHub Desktop.
Save ghostbar/ded530c54b9e3ff99012 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# vim: ft=sh
declare SSH_HOST="${SSH_HOST:-myserver.com}"
declare SSH_USER="${SSH_USER:-uploader}"
declare SSH_PORT="${SSH_PORT:-22}"
declare TAGS="${TAGS:-resnullius/alpine-armv7l:latest resnullius/alpine-armv7l:3.3 resnullius/alpine-armv7l:edge}"
for tag in $TAGS
do
echo uploading $tag
declare PUSH_CMD="${PUSH_CMD:-docker push $tag}"
docker save $tag | bzip2 | pv | ssh -p $SSH_PORT $SSH_USER@$SSH_HOST 'bunzip2 | docker load' && \
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST $PUSH_CMD
echo uploaded $tag
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment