~james-page/ubuntu-openstack-ci/drop-tox-from-slave-config

« back to all changes in this revision

Viewing changes to operate/deprecated/820-tarmac-credentials-distribute.sh

  • Committer: Ryan Beisner
  • Date: 2018-12-13 21:10:41 UTC
  • mto: This revision was merged to the branch mainline in revision 409.
  • Revision ID: ryan.beisner@canonical.com-20181213211041-5xw4jn4u17ujbv6o
Actually remove the deprecated things

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash -e
2
 
echo $0
3
 
 
4
 
# Copy launchpad credentials file to all nodes
5
 
# Requires that you have placed credentials in the populate dir
6
 
 
7
 
. $(dirname $0)/../env-common
8
 
 
9
 
f_name="credentials"
10
 
f_dst_dir="${JENKINS_HOME}/.config/tarmac"
11
 
f_dst="${f_dst_dir}/${f_name}"
12
 
f_tmp="${U_HOME}/${f_name}"
13
 
f_src_dir="../populate"
14
 
f_src="${f_src_dir}/${f_name}"
15
 
 
16
 
if [ ! -f "$f_src" ]; then
17
 
  echo "Local source file ${f_src} not found."
18
 
  pwd
19
 
  exit 1
20
 
fi
21
 
 
22
 
for unit in $UNITS; do
23
 
  echo "making tarmac config directory on ${unit}!"
24
 
  juju ssh $unit "sudo su - jenkins -c 'mkdir -p /var/lib/jenkins/.config/tarmac'"
25
 
  echo "copying ${f_src} into ${unit}"
26
 
  juju scp $f_src ${unit}:${f_tmp}
27
 
  echo "adjusting permissions"
28
 
  juju ssh $unit "sudo mv $f_tmp $f_dst &&\
29
 
    sudo chown jenkins:jenkins -R ${f_dst} &&\
30
 
    sudo chmod 600 ${f_dst}"
31
 
done
32