Skip to content

Commit ab2c997

Browse files
committed
Add a bunch of debug stuff
1 parent f61c52b commit ab2c997

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

client/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ func (c *Client) start() {
142142
}
143143
if connerr != nil {
144144
d := b.Duration()
145+
c.Debugf("Error connecting: %s", connerr)
145146
c.Infof("Retrying in %s...\n", d)
146147
connerr = nil
147148
time.Sleep(d)

deploy.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Stop processing on error
33
set -e
44

5+
echo Current environment
6+
env
7+
58
echo Configuring container
69
mkdir -p etc var/run
710

@@ -45,5 +48,5 @@ $(pwd)/openssh-portable/sshd -f etc/sshd_config
4548
# echo "$PASS" | passwd
4649

4750
# Start the webserver immediately; this prevents Cloud Foundry from killing this container
48-
./bin/chisel server --proxy http://example.com --port $PORT
51+
./bin/chisel server -v --port $PORT $SERVER_ARGS
4952

push.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ set -e # exit on error
55
cd `dirname $0`
66
source .default.sh
77

8+
# Always start a build
9+
GOPATH=$(cd ../../../..;pwd) go build &
10+
11+
# Were we called by ./tunnel?
12+
if [ "$1" == -t ]; then
13+
tunnel=yes
14+
shift
15+
fi
16+
817
# See if we're already running...
918
echo "Checking if $CHISEL_APP_NAME is running"
1019
set +e
@@ -33,6 +42,7 @@ if [ $rc -ne 0 ]; then
3342
else
3443
if echo "$out" | grep -q running; then
3544
echo "$CHISEL_APP_NAME is running; skipping push."
45+
wait # Make sure build is done
3646
exit
3747
fi
3848
fi
@@ -66,12 +76,11 @@ fi
6676

6777
echo "pushing $CHISEL_APP_NAME to cloud foundry"
6878

69-
cf push -t 180 $@ "$CHISEL_APP_NAME" & # -t: maximum number of seconds to wait for app to start
70-
71-
GOPATH=$(cd ../../../..;pwd) go build
79+
cf push -t 180 $@ "$CHISEL_APP_NAME" # -t: maximum number of seconds to wait for app to start
7280

7381
wait
7482

75-
./tunnel
83+
# If we weren't started by tunnel, run ./tunnel
84+
[ -n "$tunnel" ] || ./tunnel
7685

7786
# vi: expandtab sw=2 ts=2

server/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func (s *Server) Run(host, port string) error {
9797
}
9898

9999
func (s *Server) Start(host, port string) error {
100+
s.Debugf("Debug enabled")
100101
s.Infof("Fingerprint %s", s.fingerprint)
101102
if len(s.Users) > 0 {
102103
s.Infof("User authenication enabled")

tunnel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ esac
3939
echo "Starting $CHISEL_APP_NAME forwarding local port $CHISEL_LOCAL_PORT to remote port $CHISEL_REMOTE_PORT"
4040

4141
# Make sure that app is running
42-
./push.sh $@
42+
./push.sh -t $@
4343

4444
echo "Obtaining url for $CHISEL_APP_NAME"
4545
url=`cf app $CHISEL_APP_NAME | egrep 'routes|urls' | awk '{print $2}'`

0 commit comments

Comments
 (0)