~doanac/+junk/jenkins-slave

« back to all changes in this revision

Viewing changes to hooks/slave-relation-joined

  • Committer: Andy Doan
  • Date: 2014-05-14 21:43:52 UTC
  • Revision ID: andy.doan@canonical.com-20140514214352-2lfwhmgy00pmdyja
support configurable number of executors

based on: https://code.launchpad.net/~gandelman-a/charms/precise/jenkins-slave/extension_executors/+merge/191744

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
# Set the slave hostname to match the juju unit
6
6
# in the jenkins master instance
7
7
slavehost=`echo ${JUJU_UNIT_NAME} | sed s,/,-,`
8
 
noexecutors=`cat /proc/cpuinfo | grep processor | wc -l`
 
8
 
 
9
noexecutors=`config-get executors`
 
10
if [[ -z "$noexecutors" ]] ; then
 
11
        noexecutors=`cat /proc/cpuinfo | grep processor | wc -l`
 
12
        juju-log "Defaulting noexecutors to $noexecutors"
 
13
fi
 
14
 
9
15
config_labels=`config-get labels`
10
16
labels=`uname -p`
11
17