-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
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
wgetto download the Generic Java package (.war) from the Jenkins download page:wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war - Make sure
javais 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
javacommand. 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:9090to 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
pm2command 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
BoykaZhutheIBMiGuy
Metadata
Metadata
Assignees
Labels
No labels
