-
Notifications
You must be signed in to change notification settings - Fork 19
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
82946fe
commit 66e27d1
Showing
1 changed file
with
13 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
#!/usr/bin/env sh | ||
#!/usr/bin/env bash | ||
set -ex | ||
dir=$(dirname $0) | ||
error () { | ||
echo "=== an error occurred, logs follow ===" | ||
cat log | ||
} | ||
trap error ERR | ||
|
||
dir=$(dirname "$0") | ||
name=cf-remote-debian-test-host | ||
|
||
docker stop "$name" || true | ||
docker rm "$name" || true | ||
docker build -t "$name" "$dir" | ||
docker run -d -p 8822:22 --name "$name" "$name" | ||
docker build -t "$name" "$dir" >log 2>&1 | ||
docker run -d -p 8822:22 --name "$name" "$name" >>log 2>&1 | ||
ip_addr=$(hostname -i) | ||
ssh -o StrictHostKeyChecking=no -p 8822 root@"$ip_addr" hostname | ||
cf-remote install --clients root@"$ip_addr":8822 | ||
ssh -o StrictHostKeyChecking=no -p 8822 root@"$ip_addr" cf-agent -V | ||
ssh -o StrictHostKeyChecking=no -p 8822 root@"$ip_addr" hostname >>log 2>&1 | ||
cf-remote install --clients root@"$ip_addr":8822 >>log 2>&1 | ||
ssh -o StrictHostKeyChecking=no -p 8822 root@"$ip_addr" cf-agent -V >>log 2>&1 |