Skip to content

Commit

Permalink
let bootstrap create $HOME/.ssh when checkout with ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzacy committed Jan 30, 2018
1 parent 4cd1415 commit bbb8b15
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions jenkins/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ def job_script(job, extra_job_args):
"""Return path to script for job."""
with open(test_infra('jobs/config.json')) as fp:
config = json.loads(fp.read())
if job.startswith('pull-kubernetes-security-'):
job.replace('pull-kubernetes-security-', 'pull-kubernetes', 1)
job_config = config[job]
cmd = test_infra('scenarios/%s.py' % job_config['scenario'])
return [cmd] + job_args(job_config.get('args', []) + extra_job_args)
Expand All @@ -803,6 +805,13 @@ def choose_ssh_key(ssh):
yield
return

try:
os.makedirs(os.path.join(os.environ[HOME_ENV], '.ssh'))
except OSError as exc:
logging.info('cannot create $HOME/.ssh, continue : %s', exc)
except KeyError as exc:
logging.info('$%s does not exist, continue : %s', HOME_ENV, exc)

# Create a script for use with GIT_SSH, which defines the program git uses
# during git fetch. In the future change this to GIT_SSH_COMMAND
# https://superuser.com/questions/232373/how-to-tell-git-which-private-key-to-use
Expand Down

0 comments on commit bbb8b15

Please sign in to comment.