I was successful to build iDempiere 2.1 in SVN repository by Jenkins.
○ Environment:
CPU : AMD FX-9590 (4.7 GHz)Hypervisor : Citrix XenServer 6.5
OS : Jessie (Debian)
Jenkins : 2.19.3 (at 2016/12/15)
○install Jenkins.
Jenkins is installed on Linux by the folloings.
[root@servername ~]# -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | sudo apt-key add -
[root@servername ~]# echo "deb http://pkg.jenkins-ci.org/debian-stable binary/" | sudo tee -a /etc/apt/sources.list
[root@servername ~]# apt-get update
[root@servername ~]# apt-get install jenkins -y
[root@servername ~]# service jenkins restart
○install Eclipse Mars2.
In order to build the plugin jars of iDempiere, Eclipse must be installed. Mars2 is installed by the folloings.
[root@servername ~]# wget -q http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/mars/2/eclipse-jee-mars-2-linux-gtk-x86_64.tar.gz
[root@servername ~]# tar zxvf ./eclipse-jee-mars-2-linux-gtk-x86_64.tar.gz -C {install dir}
○Preparing the shell files for Jenkins Build.
This shell file kicks Ant Runner in Eclipse to compile all project of iDempiere.
eclipse_build.sh
export JAVA_HOME={Path to Java home dir to be used for build} export ECLIPSE_HOME={Elipse instaled dir} export BUILD_FILE={eclipse_build.xml path} export WORKSPACE={Path to workspace Jenkins creates} $JAVA_HOME/bin/java -jar $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar -application org.eclipse.ant.core.antRunner -DuseJARFormat=true -data $WORKSPACE -buildfile $BUILD_FILE
eclipse_build.xml
<?xml version="1.0" encoding="UTF-8"?> <project default="eclipse_build" name="build"> <target name="eclipse_build"> <eclipse.incrementalBuild kind="full" /> </target> </project>
This shell file kicks Ant Runner in Eclipse to export plugin jar files of iDempiere.
plugin_build.sh
export JAVA_HOME={Path to Java home dir to be used for build} export ECLIPSE_HOME={Elipse instaled dir} export BUILD_FILE={plugin_build.xml path} export WORKSPACE={Path to workspace Jenkins creates} $JAVA_HOME/bin/java -jar $ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar -application org.eclipse.ant.core.antRunner -Dplugins=$1 -DuseJARFormat=true -data $WORKSPACE -buildfile $BUILD_FILE
plugin_build.xml
<?xml version="1.0" encoding="UTF-8"?> <project default="plugin_export" name="build"> <target name="plugin_export"> <eclipse.incrementalBuild project="${plugins}" kind="full" /> <pde.exportPlugins destination="/usr/local/idempiere/jenkins/build" exportSource="false" exportType="directory" plugins="${plugins}" allowBinaryCycles="true" useJARFormat="${useJARFormat}" /> </target> </project>
○Setting Jenkins item & check out
Access to jenkins (http://{jenkins server}:8080) from browser. And create Project with the following build configuration.In sample configuration, This configuration will update SVN chckouts, execute full-build of eclipse workspace and 2 plugin projects in workspace, org.adempiere.base and org.adempiere.base.process are export as plugin jar files.
Execute Build at once to check out the resources into Jenkins workspace. After that, Jenkins workspace dir is created at "${JENKINS_HOME}/jobs/${ProjectName}/workspace" and SVN resources are checked out all in it. Default $JENKINS_HOME is "/var/lib/jenkins". If you defined Local module directory in Source Code Management, adittional directory is created under default Jenkins workspace path, then SVN resources is checked out into this.
○Configure Eclipse workspace.
Start Eclipse installed on linux.
[root@servername ~]# cd {installed dir}[root@servername ~]# ./eclipse
Open the workspace Jenkins created from Eclipse. Before build by Jenkins, all file should be close and eclipse should be shutdowned.
○Jenkins Build
Execute Jenkins build again. The latest SVN resources checked out and compiled end exporsed into plugin jar files ant then these are copied into deply dir.
○ Reference:
1. http://blog.programster.org/debian-8-install-jenkins/2. http://qiita.com/yoshi389111/items/b7c7c1dfb5411c410798


0 件のコメント:
コメントを投稿