~maxiberta/ols-jenkaas/sca-build-command-cleanup

« back to all changes in this revision

Viewing changes to slave/seed

  • Committer: Vincent Ladeuil
  • Date: 2016-07-15 13:39:16 UTC
  • Revision ID: vila+ols@canonical.com-20160715133916-efrw301s4616tezh
Rework the layout so separate the various parts: master, slave, job builder and jobs definitions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
HOST=$(hostname)
 
4
KEY_NAME=jenkins@${HOST}
 
5
KEY_PATH=~/.ssh/${KEY_NAME}
 
6
 
 
7
rm -f ${KEY_PATH} ${KEY_PATH}.pub
 
8
 
 
9
# Generate a password-less ssh key. The public part needs to be uploaded to
 
10
# launchpad as a new key for the lander bot account.
 
11
ssh-keygen -f ${KEY_PATH} -N '' -t ecdsa -C ${KEY_NAME}
 
12
echo "New public key is: $(cat ${KEY_PATH}.pub)"
 
13
 
 
14
if [ -z "$(grep '^Host \*.launchpad.net' ~/.ssh/config)" ] ; then
 
15
    cat <<EOSC >> ~/.ssh/config
 
16
 
 
17
# Generated by slave/seed $(date)
 
18
Host *.launchpad.net
 
19
    IdentityFile ${KEY_PATH}
 
20
EOSC
 
21
fi