This project is still Work In Progress
sudo apt install default-jre
sudo apt install default-jre-headless
sudo apt install openssl
It'd be safer to create a special Jenkins user to run your server. In case there's a security problem in Jenkins that allows external actor to gain access to your system, then Jenkins user will limit their accessibility.
sudo adduser jenkins
Download jenkin images and sets up networking, volumes and SSL certificates.
./setup_jenkins.sh dns:$SERVER_DNS_NAME
or
./setup_jenkins.sh ip:$SERVER_IP_ADDRESS
Where replace $SERVER_DNS_NAME/$SERVER_IP_ADDRESS with your real values. This is required to avoid python generating an error when talking to the server via myci cli due to a missing subjectAltName in the certificate.
If you're accessing the server via localhost then use that as SERVER_DNS_NAME.
./start_jenkins.sh
Jenkins is picky about which java version to use. If you encounter issues (look at nohup.out), then check the latest docs of Jenkins
https://www.jenkins.io/doc/administration/requirements/java/
You can update your PATH to point to the right java version for jenkins
user
if you had to install multiple versions of java.
firefox https://localhost:8443
username: admin
password: ./adminpass_jenkins.sh
On first run make select Install suggested plugins
. Make sure they were all
successful. If not, retry. If failure persisted, restart jenkins and try again
via
manage jenkins -> manage plugins -> available
you might want to take note of these plugins names first.
You can just use the admin user. But it is recommended to create your own user account.
Default settings are usually fine to create correct urls for the jobs.
We make use of pipelines, so having Blue Ocean plugin would be recommended, yet optional if you'd like to skip. You can install it from
Manage Jenkins -> Manage Plugins -> Available
Search for Blue Ocean
. In the returned values only select the plugin named
Blue Ocean
without any additional text.
Click Download now and install after restart
button after ticking the Blue Ocean
checkbox.
Select Restart Jenkins when installation is complete and no jobs are running
box when all dependencies are installed.
The GUI sometimes seems to have hanged when Jenkins restarts. If you stopped seeing any updates on the page, refresh it.
From Manage Plugins
page
Manage Jenkins -> Manage Plugins -> Available
Search for Copy Artifact
. Select it and install it.
From Configure System
page
Manage Jenkins -> Configure System
In Git plugin
section set Global Config user.name Value
and
Global Config user.email Value
.
Click Save
button to save and exit.
From Configure System
page
Manage Jenkins -> Configure System
In Shell
section set Shell executable
to /bin/bash
.
Click Save
button to save and exit.
From Configure System
page
Manage Jenkins -> Configure System
In Global properties
section tick Environment variables
. Then add
a variable called MYCI_BRANCH
and set the default value to main
. You can
use this variable to globally switch the default branch of all jobs.
From Configure System
page
Manage Jenkins -> Configure System
In Global Pipeline Libraries
section set name
to myci
, Default version
to main
, tick Load implicitly
and set Project Repository
to
https://github.com/qais-yousef/myci
or to your own fork of it.
Click Save
button to save and exit.
You're all ready now!
If you installed Blue Ocean
, select Open Blue Ocean
in the left hand side
menu. Then select Jenkins-Healthcheck
job to test your setup. Hit Run
when
prompted.
./start_jenkins.sh
./stop_jenkins.sh