2
from argparse import ArgumentParser
14
SCRIPTS = dirname(__file__)
18
parser = ArgumentParser()
19
parser.add_argument('host', help='The machine to test on.')
20
parser.add_argument('revision_or_tarfile',
21
help='The revision-build or tarfile path to test.')
22
parser.add_argument('package', nargs='?', default='github.com/juju/juju',
23
help='The package to test.')
24
args = parser.parse_args(argv)
26
if args.revision_or_tarfile.endswith('tar.gz'):
27
downloaded = args.revision_or_tarfile
29
revision = args.revision_or_tarfile
30
juju_ci_path = join(SCRIPTS, 'jujuci.py')
31
downloaded = subprocess.check_output([
32
juju_ci_path, 'get', '-b', revision, 'build-revision',
34
subprocess.check_call([
35
juju_ci_path, 'get-build-vars', '--summary', revision])
36
(tarfile,) = [basename(l) for l in downloaded.splitlines()]
38
with open('temp-config.yaml', 'w') as temp_file:
42
join(SCRIPTS, 'gotesttarfile.py'),
43
join(SCRIPTS, 'jujucharm.py'),
44
join(SCRIPTS, 'utility.py'),
47
'python', 'ci/gotesttarfile.py', '-v', '-g', 'go.exe', '-p',
48
args.package, '--remove', 'ci/{}'.format(tarfile)
51
juju_home = os.environ.get('JUJU_HOME',
52
join(dirname(SCRIPTS), 'cloud-city'))
53
subprocess.check_call([
54
'workspace-run', '-v', '-i', join(juju_home, 'staging-juju-rsa'),
55
'temp-config.yaml', 'Administrator@{}'.format(args.host)
59
if __name__ == '__main__':
3
SCRIPTS=$(readlink -f $(dirname $0))
4
JUJU_HOME=${JUJU_HOME:-$(dirname $SCRIPTS)/cloud-city}
8
PACKAGE=${3:-github.com/juju/juju}
10
CYG_CI_DIR="/cygdrive/c/Users/Administrator/ci"
11
CYG_PYTHON_CMD="/cygdrive/c/python27/python"
12
CI_DIR='\\Users\\Administrator\\ci'
13
GO_CMD='\\go\\bin\\go.exe'
14
SSH_OPTIONS="-i $JUJU_HOME/staging-juju-rsa \
15
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
18
DOWNLOADED=$($SCRIPTS/jujuci.py get -b $REVISION build-revision '*' ./)
19
TARFILE=$(basename $(echo "$DOWNLOADED" | grep -F tar.gz))
20
$SCRIPTS/jujuci.py get-build-vars --summary --env $HOST $REVISION
23
scp $SSH_OPTIONS ./$TARFILE $SCRIPTS/gotesttarfile.py \
24
Administrator@$HOST:$CYG_CI_DIR/
29
ssh $SSH_OPTIONS Administrator@$HOST \
30
$CYG_PYTHON_CMD $CI_DIR'\\gotesttarfile.py' -v -g $GO_CMD -p $PACKAGE \
31
--remove $CI_DIR'\\'$TARFILE