Skip to content

Instantly share code, notes, and snippets.

@tailhook
Created September 15, 2016 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tailhook/d637c1079888b4c687b7270cc92a419a to your computer and use it in GitHub Desktop.
Save tailhook/d637c1079888b4c687b7270cc92a419a to your computer and use it in GitHub Desktop.
#!/bin/sh -ex
VAGGA=${VAGGA:-vagga}
SERVER=server.example.org
PROJECT=myapp
CONTAINER=example-container
type $VAGGA
type rsync
$VAGGA _build $CONTAINER
version="$($VAGGA _version_hash --short $CONTAINER)"
rsync -a --checksum \
--link-dest=/srv/images/$PROJECT/$CONTAINER.latest/ \
.vagga/$CONTAINER-deploy/ \
$SERVER:/srv/images/$CONTAINER/$CONTAINER.${version}
ssh $SERVER ln -sfn $CONTAINER.${version} /srv/images/$PROJECT/$CONTAINER.latest
cat <<END | ssh $SERVER tee /srv/images/$PROJECT/config.yaml
nci:
kind: Daemon
instances: 1
config: /config/$CONTAINER.yaml
image: $CONTAINER.${version}
END
ssh -t $SERVER sudo lithos_switch $PROJECT /srv/images/$PROJECT/config.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment