Bug 993558 - User specified JENKINS_WAR_PATH will be ignored during jenkins server build phase
User specified JENKINS_WAR_PATH will be ignored during jenkins server build p...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Dan McPherson
libra bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-06 03:45 EDT by Meng Bo
Modified: 2015-05-14 19:25 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-07 18:59:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Meng Bo 2013-08-06 03:45:27 EDT
Description of problem:
Set JENKINS_WAR_PATH to any other available value in pre_build or build action_hook. eg, copy the jenkins.war to /root/ and set the value to /root/jenkins.war.

$ cat .openshift/action_hooks/pre_build 
#!/bin/bash
JENKINS_WAR_PATH='/root/jenkins.war'
export JENKINS_WAR_PATH='/root/jenkins.war'
echo $JENKINS_WAR_PATH

During the jenkins server building phase it will always use the default jenkins.war under /usr/lib/jenkins/.

Version-Release number of selected component (if applicable):
devenv_3616

How reproducible:
always

Steps to Reproduce:
1.Create jenkins server
2.Add pre_build action_hook with execute permission
3.Specify the JENKINS_WAR_PATH in the pre_build script
cat .openshift/action_hooks/pre_build 
#!/bin/bash
JENKINS_WAR_PATH='/root/jenkins.war'
export JENKINS_WAR_PATH='/root/jenkins.war'
echo JENKINS_WAR_PATH=$JENKINS_WAR_PATH
4.Git push
5.Check the jenkins server log
$ rhc tail jenkins

Actual results:
The jenkins app will always use the /usr/lib/jenkins/jenkins.war when building.

jenkins.log:
Running from: /usr/lib/jenkins/jenkins.war
webroot: System.getProperty("JENKINS_HOME")
Aug 06, 2013 12:52:13 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jenkins home directory: /var/lib/openshift/955786308154953985687552/app-root/data found at: System.getProperty("JENKINS_HOME")
Aug 06, 2013 12:52:17 AM winstone.Logger logInternal
INFO: HTTP Listener started: port=8080
Aug 06, 2013 12:52:17 AM winstone.Logger logInternal

Expected results:
User can specify the customized war for the JENKINS_WAR_PATH

Additional info:
In the control script, there are following lines

  if [ -z "$JENKINS_WAR_PATH" ]; then
         JENKINS_WAR_PATH=/usr/lib/jenkins/jenkins.war
  fi


And the JENKINS_WAR_PATH can be printed out in the git push output.

Total 4 (delta 0), reused 0 (delta 0)
remote: Stopping jenkins cart
remote: Waiting for stop to finish
remote: Starting application jenkins
remote: JENKINS_WAR_PATH=/root/jenkins.war
remote: Starting jenkins cart
remote: Waiting ...
remote: Waiting ...
remote: Still waiting ...
To ssh://871880341879427059154944@jenkins-bmeng1dev.dev.rhcloud.com/~/git/jenkins.git/
   748bcc6..a39cab4  master -> master
Comment 1 Dan McPherson 2013-08-06 13:13:43 EDT
I am not sure that pre_build ever worked for this use case.  I am assuming it does based on the bug being opened.  But I think you want to use pre_start_jenkins since otherwise the war you specify would only be used when you push to jenkins (which is a strange thing to do really).  I tried using pre_start_jenkins and that seem to work fine.

-Dan
Comment 2 Meng Bo 2013-08-07 02:04:38 EDT
As Dan said, this worked when set the war_path in pre_start_jenkins-1.4 script.

remote: Stopping jenkins cart
remote: Waiting for stop to finish
remote: Starting application jenkins
remote: JENKINS_WAR_PATH=/root/jenkins.war
remote: Starting jenkins cart
remote: Error: Unable to access jarfile /root/jenkins.war
remote: Waiting ...
remote: Waiting ...
remote: Waiting ...


Close this bug.

Note You need to log in before you can comment on or make changes to this bug.