blog
blog copied to clipboard
Setting up Jenkins on IBM i
I've been using Jenkins a lot lately and thought it'd be nice to share how to get Jenkins setup easily on your IBM i. I am using wget
in this post, which is available through yum
.
Installation
- use
wget
to download the Generic Java package (.war) from the Jenkins download page:wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
- Make sure
java
is on your path. For example, here is where Java is on my system:
bash-4.4$ echo $PATH
/QOpenSys/pkgs/bin:/QOpenSys/pkgs/lib/nodejs10/bin:/QOpenSys/usr/bin:/usr/ccs/bin:.:/usr/bin
bash-4.4$ which java
/QOpenSys/usr/bin/java
- Start Jenkins with the
java
command. Note here I am starting Jenkins on port 9090. If you don't provide that parameter it starts on port 8080:
bash-4.4$ java -jar jenkins.war --httpPort=9090
Running from: /home/BARRY/jenkins.war
webroot: $user.home/.jenkins
...
- You can then head to
hostname:9090
to access Jenkins:
Keeping Jenkins running as a service
Using SBMJOB
- A very simple submit-job with a job-name will suffice.
SBMJOB CMD(QSH CMD('java -jar /home/BARRY/jenkins.war --httpPort=9091')) JOB(JENKINS)
Using pm2
- Make sure pm2 is setup.
- Create an ecosystem file for pm2 which calls Java and has the correct parameters to start Jenkins:
{
"apps":[
{
"name":"jenkins",
"cwd":".",
"script":"/QOpenSys/usr/bin/java",
"args":[
"-jar",
"jenkins.war",
"--httpPort=9090"
],
"exec_interpreter":"",
"exec_mode":"fork"
}
]
}
- Use the
pm2
command to launch your ecosystem file, which will start Jenkins up.
bash-4.4$ pm2 start apps.json
[PM2][WARN] Applications jenkins not running, starting...
[PM2] App [jenkins] launched (1 instances)
┌──────────┬────┬─────────┬──────┬─────────┬─────────┬─────────┬────────┬─────┬────────┬───────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼─────────┼──────┼─────────┼─────────┼─────────┼────────┼─────┼────────┼───────┼──────────┤
│ gonext │ 1 │ 1.0.0 │ fork │ 0 │ stopped │ 25 │ 0 │ 0% │ 0 B │ barry │ disabled │
│ index │ 0 │ 1.0.0 │ fork │ 0 │ stopped │ 0 │ 0 │ 0% │ 0 B │ barry │ disabled │
│ jenkins │ 3 │ N/A │ fork │ 1026587 │ online │ 0 │ 0s │ 0% │ 0 B │ barry │ disabled │
│ rpgfree │ 2 │ 1.0.0 │ fork │ 18106 │ online │ 0 │ 2M │ 0% │ 0 B │ barry │ disabled │
└──────────┴────┴─────────┴──────┴─────────┴─────────┴─────────┴────────┴─────┴────────┴───────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
Hi, appreciate you left this post a few years back, but found it recently and used it to get Jenkins running on IBM i. However, having an issue where characters are showing up in a funny character set and apart from not being able to read them without getting the Hex code and translating, the unreadable characters seem to be causing errors in the build.
Do you know how we could set the encoding or CCSID for Jenkins to have the character set use UTF-8 or something readable?