-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
179c638
commit 63a9b94
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
#!/bin/sh | ||
|
||
echo "Here we can do anything when deployment has finished." | ||
echo "Such as kicking off a second build stage." | ||
# At the $HOST, the $USER needs to have an .ssh directory with | ||
# authorized_keys matching $SECRET. | ||
|
||
set -e | ||
|
||
HOST=hactrn.org | ||
PORT=22 | ||
USER=images | ||
DIR=/var/www/hactrn.org/images | ||
|
||
SSH=$HOME/.ssh | ||
ID=$SSH/id_rsa | ||
|
||
if test -z "$SECRET"; then | ||
echo 'ERROR: No key in $SECRET.' | ||
exit 1 | ||
fi | ||
|
||
mkdir -p $SSH | ||
chmod 700 $SSH | ||
echo "$SECRET" > $ID | ||
chmod 600 $ID | ||
|
||
ssh-keyscan -p $PORT -H $HOST >> ~/.ssh/known_hosts | ||
|
||
(cd out; tar czf $EMULATOR.tgz $EMULATOR) | ||
|
||
echo "Deploying to $USER@$HOST:$PORT" | ||
rsync -av --inplace -e "ssh -p$PORT -l$USER" out/$EMULATOR.tgz $HOST:$DIR | ||
|
||
exit 0 |