File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,24 +5,28 @@ log() {
55 echo " >> [local]" $@
66}
77
8- log " Packing workspace into archive to transfer onto remote machine."
9- tar cjvf /tmp/workspace.tar.bz2 --exclude .git .
10-
11- log " Launching ssh agent."
12- eval ` ssh-agent -s`
138cleanup () {
9+ set +e
1410 log " Killing ssh agent."
1511 ssh-agent -k
12+ log " Removing workspace archive."
13+ rm -f /tmp/workspace.tar.bz2
1614}
1715trap cleanup EXIT
1816
17+ log " Packing workspace into archive to transfer onto remote machine."
18+ tar cjvf /tmp/workspace.tar.bz2 --exclude .git .
19+
20+ log " Launching ssh agent."
21+ eval ` ssh-agent -s`
22+
1923ssh-add <( echo " $SSH_PRIVATE_KEY " )
2024
2125remote_command=<< EOF
2226set -e
2327
2428log() {
25- echo ">> [remote]" $@
29+ echo ">> [remote]" \ $ @
2630}
2731
2832cleanup() {
@@ -31,20 +35,21 @@ cleanup() {
3135}
3236
3337log "Creating workspace directory..."
34- mkdir "$ $ HOME/workspace"
38+ mkdir "\ $ HOME/workspace"
3539trap cleanup EXIT
3640
3741log "Unpacking workspace..."
38- tar -C "$ $ HOME/workspace" xjv
42+ tar -C "\ $ HOME/workspace" xjv
3943
4044log "Launching docker-compose..."
4145COMPOSE_PROJECT="$DOCKER_COMPOSE_PREFIX "
4246COMPOSE_FILENAME="$DOCKER_COMPOSE_FILENAME "
43- cd $ $ HOME/workspace
47+ cd \ $ HOME/workspace
4448docker-compose up -d
4549EOF
4650
4751echo " >> [local] Connecting to remote host."
4852ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
4953 " $SSH_USER @$SSH_HOST " -p " $SSH_PORT " \
50- " $remote_command "
54+ " $remote_command " \
55+ < /tmp/workspace.tar.bz2
You can’t perform that action at this time.
0 commit comments