Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ source 'https://supermarket.chef.io'
# Checks metadata.rb for dependencies
metadata

cookbook "jenkins", "9.5.19"
cookbook "jenkins", git: "https://github.com/ros-infrastructure/cookbook-jenkins", branch: "latest"
1 change: 1 addition & 0 deletions files/jenkins/service/500-timeout.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[Service]
TimeoutStartSec=180
RestartSec=10s
StartLimitBurst=10

4 changes: 2 additions & 2 deletions kitchen.dokken.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ provisioner:
chef_output_format: doc

platforms:
- name: ubuntu-20.04
- name: ubuntu-24.04
driver:
image: dokken/ubuntu-20.04
image: dokken/ubuntu-24.04
pid_one_command: /bin/systemd
intermediate_instructions:
- RUN /usr/bin/apt-get update
Expand Down
2 changes: 1 addition & 1 deletion kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ provisioner:
environment: test

platforms:
- name: ubuntu-20.04
- name: ubuntu-24.04

verifier:
name: inspec
Expand Down
2 changes: 2 additions & 0 deletions recipes/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@
file.insert_line_if_no_match(%r[\$nrconf\{override_rc\}\{qr\(\^jenkins-agent\\\.service\$\)\} = 0;], %q[$nrconf{override_rc}{qr(^jenkins-agent\.service$)} = 0;])
file.write_file
end

only_if { File.exist? "/etc/needrestart/needrestart.conf" }
end

template '/etc/systemd/system/jenkins-agent.service' do
Expand Down
11 changes: 8 additions & 3 deletions recipes/jenkins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
file.insert_line_if_no_match(%r[\$nrconf\{override_rc\}\{qr\(\^jenkins\\\.service\$\)\} = 0;], %q[$nrconf{override_rc}{qr(^jenkins\.service$)} = 0;])
file.write_file
end

only_if { File.exist? "/etc/needrestart/needrestart.conf" }
end

# Jenkins downgrade protection
Expand Down Expand Up @@ -94,6 +96,11 @@

# Increase timeout of jenkins systemd unit
# Timeout extension prevents Jenkins startup failures due to slow init scripts execution
execute "systemctl-daemon-reload" do
command "systemctl daemon-reload"
action :nothing
end

directory '/etc/systemd/system/jenkins.service.d' do
mode '0755'
owner 'root'
Expand All @@ -104,11 +111,9 @@
source 'jenkins/service/500-timeout.conf'
owner 'root'
group 'root'
notifies :run, 'execute[systemctl-daemon-reload]', :immediately
end

execute "systemctl-daemon-reload" do
command "systemctl daemon-reload"
end

# Set up authentication
chef_user = search('ros_buildfarm_jenkins_users', 'chef_user:true').first
Expand Down
Loading