Howdy people,

in this HowTo I want to show you how to upgrade Jenkins automatically.

Maybe you know the unattended-upgrade package.
Especially for security updates this package can be useful and important.

For example, an important update for Apache 2.4 came out in the night – and my server just installed it automatically.

Nothing is more convenient to wake up, check your iPhone and see that the security updates are installed.

First install unattended-upgrades

sudo apt-get install unattended-upgrades

 

Cofiguration

Now you need to add the file /etc/apt/apt.conf.d/20auto-upgrades

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

Now the unattended upgrades are enabled.

Next edit the unattended-upgrades config in /etc/apt/apt.conf.d/50unattended-upgrades
To enable Jenkins add this entry to Allowed-Origins

"jenkins-ci.org:binary";

Mine looks like this

Unattended-Upgrade::Allowed-Origins {
        "${distro_id}:${distro_codename}-security";
        "${distro_id}:${distro_codename}-updates";
        "jenkins-ci.org:binary";
//      "${distro_id}:${distro_codename}-proposed";
//      "${distro_id}:${distro_codename}-backports";
};

 

Pro tip: Email the result 🙂

When you have mailx installed, you can deliver an E-Mail to any configured address, containing the results.
Simply add or uncomment

Unattended-Upgrade::Mail "[email protected]";

 
 
Thanks for reading – looking forward to hear from you 🙂
Cheers,
Tim

HowTo – Unattended Upgrades for Jenkins
The short URL of this article is: https://dustpla.net/gZlFJ

Leave a Reply

Your email address will not be published. Required fields are marked *