6
echo "usage: $0 INSTANCE_ID"
7
echo " INSTANCE_ID: The EC2 intance_id of the windown test machine."
12
: ${LOCAL_JENKINS_URL=$JENKINS_URL}
13
test $# -eq 1 || usage
15
# Remove previous tarballs and installers from the workspace
19
TARFILE=$(python <<EOT
24
build_data = urllib2.urlopen(
25
'$LOCAL_JENKINS_URL/job/build-revision/lastSuccessfulBuild/api/json')
26
build_json = json.load(build_data)
27
for artifact in build_json['artifacts']:
28
filename = artifact['fileName']
29
if filename.endswith('.tar.gz'):
36
ARTIFACT=$LOCAL_JENKINS_URL/job/build-revision/lastSuccessfulBuild/artifact
37
wget -q $ARTIFACT/$TARFILE
38
VERSION=$(basename $TARFILE .tar.gz | cut -d '_' -f2)
40
echo Starting instance $INSTANCE_ID
41
euca-start-instances $INSTANCE_ID
49
echo -n Waiting for IP address
50
while [ -z "$instance_ip" ]; do
52
instance_ip=$(euca-describe-instances $INSTANCE_ID |
58
echo Instance has ip $instance_ip
61
echo -n Waiting for SSH
62
while ! netcat $instance_ip 22 -w 1 -q 0 </dev/null >/dev/null; do
70
CI_DIR="/cygdrive/c/Users/Administrator/ci"
71
scp -i $JUJU_HOME/staging-juju-rsa \
72
-o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" \
73
$WORKSPACE/$TARFILE $RELEASE_TOOLS/winbuildtest.py \
74
Administrator@$instance_ip:$CI_DIR/
78
ssh -i $JUJU_HOME/staging-juju-rsa \
79
-o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" \
80
Administrator@$instance_ip \
81
'/cygdrive/c/python27/python \\Users\\Administrator\\ci\\winbuildtest.py' \
86
scp -i $JUJU_HOME/staging-juju-rsa \
87
-o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" \
88
Administrator@$instance_ip:$CI_DIR/juju-setup-$VERSION.exe $WORKSPACE/
91
euca-stop-instances $INSTANCE_ID