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.
Recommended reading to follow along and go beyond this guide:
Jenkins is released under the MIT License.
We’re using Java version 14 (9, 10 and 12 are currently not supported by Jenkins, 8 and 11 are no longer provided by uberspace).
[isabell@stardust ~]$ java -version openjdk version "14.0.1" 2020-04-14 OpenJDK Runtime Environment 20.3 (build 14.0.1+7) OpenJDK 64-Bit Server VM 20.3 (build 14.0.1+7, 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)... 22.214.171.124 Connecting to mirrors.jenkins.io (mirrors.jenkins.io)|126.96.36.199|: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)... 188.8.131.52, 2600:3404:200:237::2 Connecting to ftp-nyc.osuosl.org (ftp-nyc.osuosl.org)|184.108.40.206|: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 is stored in
[isabell@stardust ~]$ cat ~/.jenkins/secrets/initialAdminPassword SOMEHEXTHATIWONTTELLYOU [isabell@stardust ~]$
Just 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.Written by: Raphael Höser <firstname.lastname@example.org>