We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f7c80e commit 3ea98cbCopy full SHA for 3ea98cb
1 file changed
entrypoint.sh
@@ -8,6 +8,16 @@ log() {
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`
13
+cleanup() {
14
+ log "Killing ssh agent."
15
+ ssh-agent -k
16
+}
17
+trap cleanup EXIT
18
+
19
+ssh-add <(echo "$SSH_PRIVATE_KEY")
20
21
remote_command=<< EOF
22
set -e
23
@@ -35,7 +45,6 @@ docker-compose up -d
35
45
EOF
36
46
37
47
echo ">> [local] Connecting to remote host."
38
-ssh -i <(echo "$SSH_PRIVATE_KEY") \
39
- -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
48
+ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
40
49
"$SSH_USER@$SSH_HOST" -p "$SSH_PORT" \
41
50
"$remote_command"
0 commit comments