Skip to content

Commit

Permalink
setting fsroot to slave_home for the swarm jar
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgueni Ratchev authored and R. Tyler Croy committed Apr 24, 2014
1 parent 1437e2e commit 6d26e67
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions manifests/slave.pp
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
$labels_flag = ''
}

if $slave_home {
$fsroot_flag = "-fsroot ${slave_home}"
}
else {$fsroot_flag = ''}


# choose the correct init functions
case $::osfamily {
Debian: {
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/jenkins_slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
it { should contain_file('/etc/init.d/jenkins-slave') }
it { should contain_service('jenkins-slave') }
it { should contain_user('jenkins-slave_user').with_uid(nil) }
it { should contain_file('/etc/init.d/jenkins-slave').with_content(/-fsroot \/home\/jenkins-slave/) }
end

describe 'with ssl verification disabled' do
Expand All @@ -30,6 +31,7 @@
it { should contain_file('/etc/init.d/jenkins-slave') }
it { should contain_service('jenkins-slave') }
it { should contain_user('jenkins-slave_user').with_uid(nil) }
it { should contain_file('/etc/default/jenkins-slave').with_content(/-fsroot \/home\/jenkins-slave/) }
end
describe 'with ssl verification disabled' do
let(:params) { { :disable_ssl_verification => true } }
Expand Down
2 changes: 1 addition & 1 deletion templates/jenkins-slave-defaults.Debian
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ EXECUTORS=<%= @executors -%>
CLIENT_NAME=<%= @fqdn -%>


JENKINS_SLAVE_ARGS="<%= @ui_user_flag -%> <%= @ui_pass_flag -%> -name $CLIENT_NAME <%= @disable_ssl_verification_flag -%> -executors $EXECUTORS $MASTER_URL"
JENKINS_SLAVE_ARGS="<%= @ui_user_flag -%> <%= @ui_pass_flag -%> -name $CLIENT_NAME <%= @disable_ssl_verification_flag -%> -executors $EXECUTORS $MASTER_URL <%= @fsroot_flag -%>"
2 changes: 1 addition & 1 deletion templates/jenkins-slave.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi

slave_start() {
echo Starting Jenkins Slave...
$RUNUSER - <%= @slave_user -%> -c 'java -jar <%= @slave_home -%>/<%= @client_jar -%> <%= @ui_user_flag -%> <%= @ui_pass_flag -%> -mode <%= @slave_mode -%> -name <%= @fqdn || @hostname -%> -executors <%= @executors -%> <%= @masterurl_flag -%> <%= @labels_flag -%> <%= @disable_ssl_verification_flag -%> &'
$RUNUSER - <%= @slave_user -%> -c 'java -jar <%= @slave_home -%>/<%= @client_jar -%> <%= @ui_user_flag -%> <%= @ui_pass_flag -%> -mode <%= @slave_mode -%> -name <%= @fqdn || @hostname -%> -executors <%= @executors -%> <%= @masterurl_flag -%> <%= @labels_flag -%> <%= @disable_ssl_verification_flag -%> <%= @fsroot_flag -%> &'
pgrep -f -u <%= @slave_user -%> <%= @client_jar -%> > $PID_FILE
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCK_FILE
Expand Down

0 comments on commit 6d26e67

Please sign in to comment.