Created
September 15, 2016 19:53
-
-
Save tailhook/d637c1079888b4c687b7270cc92a419a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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