Bug 868053 - allow user to customize non-jenkins maven builds
Summary: allow user to customize non-jenkins maven builds
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Bill DeCoste
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-19 01:04 UTC by Bill DeCoste
Modified: 2015-05-14 23:01 UTC (History)
3 users (show)

Fixed In Version: > = ami-3e9f1a57
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-19 19:25:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Bill DeCoste 2012-10-19 01:04:35 UTC
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 19:16:36 UTC
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 06:53:35 UTC
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 15:26:50 UTC
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.