Jenkins is an open source automation server written in Java. Jenkins helps to automate the non-human part of the software development process, with continuous integration and facilitating technical aspects of continuous delivery. It is a server-based system that runs in servlet containers such as Apache Tomcat. It supports version control tools, including AccuRev, CVS, Subversion, Git, Mercurial, Perforce, TD/OMS, ClearCase and RTC, and can execute Apache Ant, Apache Maven and sbt based projects as well as arbitrary shell scripts and Windows batch commands. The creator of Jenkins is Kohsuke Kawaguchi. Released under the MIT License, Jenkins is free software.
Builds can be triggered by various means, for example by commit in a version control system, by scheduling via a cron-like mechanism and by requesting a specific build URL. It can also be triggered after the other builds in the queue have completed. Jenkins functionality can be extended with plugins.
Jenkins is released under the MIT License.
We’re using Java version 17, check the version to confirm:
[isabell@stardust ~]$ $ java -version openjdk version "17.0.2" 2022-01-18 OpenJDK Runtime Environment 21.9 (build 17.0.2+8) OpenJDK 64-Bit Server VM 21.9 (build 17.0.2+8, mixed mode, sharing) [isabell@stardust ~]$
Your URL needs to be setup:
[isabell@stardust ~]$ uberspace web domain list isabell.uber.space [isabell@stardust ~]$
First create a folder called
Jenkins and a subfolder called
Jenkins_home will hold all your Jenkins’s data.
[isabell@stardust ~]$ mkdir ~/Jenkins/Jenkins_home -p [isabell@stardust ~]$
Next we download the current version of Jenkins:
[isabell@stardust ~]$ wget -O Jenkins/jenkins.war http://mirrors.jenkins.io/war/latest/jenkins.war --2019-05-24 15:33:32-- http://mirrors.jenkins.io/war/latest/jenkins.war Resolving mirrors.jenkins.io (mirrors.jenkins.io)... 18.104.22.168 Connecting to mirrors.jenkins.io (mirrors.jenkins.io)|22.214.171.124|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://ftp-nyc.osuosl.org/pub/jenkins/war/2.178/jenkins.war [following] --2019-05-24 15:33:32-- http://ftp-nyc.osuosl.org/pub/jenkins/war/2.178/jenkins.war Resolving ftp-nyc.osuosl.org (ftp-nyc.osuosl.org)... 126.96.36.199, 2600:3404:200:237::2 Connecting to ftp-nyc.osuosl.org (ftp-nyc.osuosl.org)|188.8.131.52|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 77273755 (74M) [application/x-java-archive] Saving to: ‘Jenkins/jenkins.war’ 100%[====================================================>] 77,273,755 21.4MB/s in 3.7s 2019-05-24 15:33:36 (20.1 MB/s) - ‘Jenkins/jenkins.war’ saved [77273755/77273755] [isabell@stardust ~]$
At this point you would already be able to run Jenkins, but you wouldn’t be able to connect to it and it would not run as a service.
We create the service file
~/etc/services.d/jenkins.ini and fill it with:
[program:jenkins] directory=%(ENV_HOME)s/Jenkins/Jenkins_home environment=JENKINS_HOME="%(ENV_HOME)s/Jenkins/Jenkins_home" command=java -jar %(ENV_HOME)s/Jenkins/jenkins.war --httpPort=8080 --enable-future-java
After creating the configuration, tell supervisord to refresh its configuration and start the service:
[isabell@stardust ~]$ supervisorctl reread SERVICE: available [isabell@stardust ~]$ supervisorctl update SERVICE: added process group [isabell@stardust ~]$ supervisorctl status SERVICE RUNNING pid 26020, uptime 0:03:14 [isabell@stardust ~]$
Your Jenkins is now up and running as a service.
Finally we’ll setup our connection to the rest of the world.
Setup Web backend¶
Jenkins is running on port 8080.
To make the application accessible from the outside, configure a web backend:
[isabell@stardust ~]$ uberspace web backend set / --http --port <port> Set backend for / to port <port>; please make sure something is listening! You can always check the status of your backend using "uberspace web backend list". [isabell@stardust ~]$
First connect and initial password¶
Now you can go to
https://isabell.uber.space and see the Jenkins asking for your initial password. It will tell you the path where it is stored, most probably it should be in a file in
[isabell@stardust ~]$ cat ~/Jenkins/Jenkins_home/secrets/initialAdminPassword SOMEHEXTHATIWONTTELLYOU [isabell@stardust ~]$
Copy and paste that and you’ll be good to go. Just follow the setup and everything should work out.
To jump to a new version just replace the old war with the new version.
Recommended reading to follow along and go beyond this guide: