diff --git a/tests/run.sh b/tests/run.sh index b13d90dff84..d2917272836 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -36,6 +36,12 @@ cp bazel-bin/tests/smoke/linux_amd64_stripped/go_default_test tectonic-dev/smoke export PATH="${PWD}/tectonic-dev/installer:${PATH}" cd tectonic-dev +### HANDLE SSH KEY ### +if [ ! -f ~/.ssh/id_rsa.pub ]; then + echo -e "\\e[36m Generating SSH key-pair...\\e[0m" + ssh-keygen -qb 2048 -t rsa -f ~/.ssh/id_rsa -N "" "${CLUSTER_NAME}.yaml" import datetime + import os.path import sys import yaml @@ -66,6 +73,8 @@ python <<-EOF >"${CLUSTER_NAME}.yaml" with open('examples/tectonic.aws.yaml') as f: config = yaml.load(f) config['name'] = '${CLUSTER_NAME}' + with open(os.path.expanduser(os.path.join('~', '.ssh', 'id_rsa.pub'))) as f: + config['admin']['sshKey'] = f.read() config['baseDomain'] = '${DOMAIN}' config['pullSecretPath'] = '${PULL_SECRET_PATH}' config['aws']['region'] = '${AWS_REGION}' @@ -83,13 +92,6 @@ python <<-EOF >"${CLUSTER_NAME}.yaml" echo -e "\\e[36m Initializing Tectonic...\\e[0m" tectonic init --config="${CLUSTER_NAME}".yaml -### HANDLE SSH KEY ### -if [ ! -f ~/.ssh/id_rsa.pub ]; then - echo -e "\\e[36m Generating SSH key-pair...\\e[0m" - ssh-keygen -qb 2048 -t rsa -f ~/.ssh/id_rsa -N ""