Bug 868053 - allow user to customize non-jenkins maven builds
allow user to customize non-jenkins maven builds
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Bill DeCoste
libra bugs
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-18 21:04 EDT by Bill DeCoste
Modified: 2015-05-14 19:01 EDT (History)
3 users (show)

See Also:
Fixed In Version: > = ami-3e9f1a57
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-19 14:25:32 EST
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 Bill DeCoste 2012-10-18 21:04:35 EDT
Description of problem:
user is stuck with clean package -Popenshift -DskipTests


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


How reproducible:
always


Steps to Reproduce:
1. create and build any jboss app
2. try to customize maven opts
3.
  
Actual results:
you can't

Expected results:
you can


Additional info:
Comment 1 Bill DeCoste 2012-10-24 15:16:36 EDT
Cannot modify MAVEN_OPTS/MAVEN_ARGS from existing action hooks so need to
1) add .openshift/action_hooks/pre_build_jbossas-7
2) Modify build.sh:
        if [ -f "${OPENSHIFT_REPO_DIR}/.openshift/action_hooks/pre_build_jbossas-7" ]
        then
           echo "Sourcing pre_build_jbossas-7" 1>&2
           source ${OPENSHIFT_REPO_DIR}/.openshift/action_hooks/pre_build_jbossas-7
        fi


        if [ -z "$MAVEN_OPTS" ]; then
        	export MAVEN_OPTS="$OPENSHIFT_MAVEN_XMX"
        fi
        if [ -z "$MAVEN_ARGS" ]; then
		export MAVEN_ARGS="clean package -Popenshift -DskipTests"
        fi
        export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH
        pushd ${OPENSHIFT_REPO_DIR} > /dev/null
 
        if [ -n "$OPENSHIFT_MAVEN_MIRROR" ]
        then
            mvn --global-settings $OPENSHIFT_MAVEN_MIRROR --version
            mvn --global-settings $OPENSHIFT_MAVEN_MIRROR $MAVEN_ARGS
        else
            mvn --version
            mvn $MAVEN_ARGS
        fi
Comment 2 Jianwei Hou 2012-11-09 01:53:35 EST
Verified on devenv_2445

Steps:
1. Create jbossas-7 application
2. In app's local repo, edit .openshift/action_hooks/pre_build_jbossas-7, set some values for MAVEN_OPTS/MAVEN_ARGS, eg:

export MAVEN_OPTS="-Xmx512m"
export MAVEN_ARGS="clean package -Popenshift -DskipTests --debug"

3. git push

Result:
During git push, MAVEN_OPTS/MAVEN_ARGS are sourced and works as expected.
Comment 3 Chris Ryan 2013-10-22 11:26:50 EDT
In following comment #2 above, I am unable to see the MAVEN_OPTS being set to Xmx512m. During the build, it shows MAVEN_OPTS=-Xmx384m. 

To reproduce: I have created a jbossas-7 app, then created .openshift/action_hooks/pre_build_jbossas-7, and committed/pushed the changes: export MAVEN_OPTS="-Xmx512m"
export MAVEN_ARGS="clean package -Popenshift -DskipTests --debug".

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