build automation for xpages - auslug 2015

92
Build Automation for XPages Cameron Gregor | Senior Systems Engineer Jord International Pty Ltd www.jord.com.au

Upload: gregorbyte

Post on 28-Jul-2015

436 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Build automation for XPages - AUSLUG 2015

Build Automation for XPages

Cameron Gregor | Senior Systems Engineer Jord International Pty Ltdwww.jord.com.au

Page 2: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Cameron Gregor

• Blog – gregorbyte.com

• Twitter - @gregorbyte

• Github - camac

Page 3: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Agenda

● What is Build Automation?

● Introduction to APACHE ANT

● Introduction to Jenkins CI Server

● Building NSF from Source with Headless Designer

● Building OSGi plugins with PDE Build

● Deployment Considerations

Page 4: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

WHAT IS BUILD AUTOMATION?

Page 5: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

What do we mean by build automation?• Automation of common tasks in software development

– Compiling Source Code

– Running Tests

– Generating Documentation

– Deploying to Production / Testing

• Repeatable– Avoid human error

– Avoid dependency on key personnel

Page 6: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Basic Tools involved for a Build ‘Job’

• A Script of Tasks to follow

• A Computer to run the script

• Some programs to execute the Tasks

• A mechanism to Trigger the Job

Page 7: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Example Build Job

Checkout Source Code

Ensure Dependencies

Met

Compile

Package into an Artifact

Page 8: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

INTRODUCTION TO APACHE ANT

Page 9: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

http://ant.apache.org/• ANT = Another Neat Tool

• Written in Java– Platform independent

• Mainly used for building Java applications– However: can be used for anything

• Easily Extensible via ‘antlibs’ (ant libraries)

• Run from command lineant

Page 10: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Why ANT?• It worked!

• Documentation was easy to follow

• Extending it was easy to follow

• Installation was easy

• Very Flexible (Some say this is a disadvantage though)

• Alternatives– Gradle: I hear this is pretty good but I don’t know much about it

– Maven: I tried to give this a go but It was too big a learning curve for too little gain

– others

Page 11: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

ANT Concepts

Build File (build.xml)

Project (root node)

Target• Task• Task• Task

Target• Task• Task

Target• Task• Task• Task

Page 12: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Example Tasks

• Print Hello World to the Console<echo message=“Hello, world”/>

• Make a new Directory<mkdir dir=“lib”/>

• Compile java<javac srcdir="${src}" destdir="${build}" classpath="xyz.jar" debug="on" source="1.4" />

• Create a Zip File<zip destfile="${dist}/manual.zip“basedir="htdocs/manual"/>

• Execute a program<exec executable=“some.exe” failonerror=“true”/>

Page 13: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Example Build File

Page 14: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Example Build File Output

> ant

Buildfile: V:\Projects\SimpleBuildFile\build.xml

clean: [delete] Deleting directory V:\Projects\SimpleBuildFile\build

init: [mkdir] Created dir: V:\Projects\SimpleBuildFile\build

build: [touch] Creating V:\Projects\SimpleBuildFile\build\bar.txt

BUILD SUCCESSFULTotal time: 0 seconds

Page 15: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Properties• Similar to a ‘parameter’ or argument

• Provide a way to allow customisation of a build, – e.g. specify different directory locations, different options

• Reduce duplication of strings within the build file

Page 16: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Setting Properties within Build File• Set a property to a Value

– <property name=“propname” value=“propvalue”/>

• Set a property to a File or Directory Location (relative to base directory)– <property name=“propname” location=“someDir/someFile”/>

• Properties can be read from a ‘properties’ file from within build file<property file=“build.properties”/>

Page 17: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Setting Properties when Calling Ant• Properties can be passed in via command line when calling ant using –D flag

ant –Dproperty=value

• Or read from properties file from command lineant –propertyfile build.properties

Page 18: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Build File Using Property

Page 19: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Buildfile: V:\Projects\SimpleBuildFile\buildUsingProperty.xml

clean: [delete] Deleting directory V:\Projects\SimpleBuildFile\buildPropertyCmdLine

init: [mkdir] Created dir: V:\Projects\SimpleBuildFile\buildPropertyCmdLine

build: [touch] Creating V:\Projects\SimpleBuildFile\buildPropertyCmdLine\bar.txt

BUILD SUCCESSFULTotal time: 0 seconds

Build with Property Output

>ant –buildfile buildUsingProperty.xml -DbuildDir=buildPropertyCmdLine

Page 20: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

INTRODUCTION TO JENKINS CI

Page 21: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Jenkins CI Server• An application that monitors executions of repeated jobs with focus on

– Building / Testing Software projects continuously

– Monitoring executions of externally run jobs such as cron jobs

• Easy installation, no database required

• Distributed builds, master / slave possible

• Extensible via Plugins, with a plugin directory ready to access.

• Web Interface with rest-like api as well

• Requires JRE of 1.6 or later

• FREE! As in Speech and Beer – MIT License, very permissive

Page 22: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Jenkins vs Hudson• https://jenkins-ci.org/

• Originally created at Sun Microsystems as ‘Hudson’

• Dispute between Project Team and Oracle

• ‘Jenkins’ created as a Fork

• Kohsuke Kawaguchi is Creator and went with Jenkins

• Hudson is still available too http://hudson-ci.org/@kohsukekawa

Page 23: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Note: the following Screen shots are

taken from a Jenkins installation with

additional plugins installed so may look

different to your install

Page 24: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Home Page

Page 25: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Status Icons• S = Last run status

– Grey = Disabled

– Blue = Success

– Red = Fail

• W = Health of Recent Builds (last 5)– Sunny - all succeeded

– Sunny with Cloud = 1 failed

– Cloud = 2 failed

– Rain 3 failed

– Lightning – all recent builds failed

Page 26: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Project Page

Page 27: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Project Workspace

Page 28: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Configure Project

Page 29: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Configure – Source Code Repo

Page 30: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Configure – Trigger

Page 31: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Configure – Build Steps

Page 32: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Configure – Post Build Actions

Page 33: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Build Page

Page 34: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Build – Console Output

Page 35: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Manage Jenkins

Page 36: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Global Properties

Page 37: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Manage Plugins

Page 38: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Chuck Norris

Page 39: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Jenkins - Conclusion• Price is right

• Good community – lots of plugins

• Easy to install and backup

• Works for us!

Page 40: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

BUILDING NSF FROM SOURCE WITH HEADLESS DESIGNER

Page 41: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Domino Designer Source Control Enablement

NSF ODP

Page 42: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

The .project file

Page 43: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Headless Designer• Not Really Headless though

• New feature since 9.0.1

• Allows for automated building of NSF from On Disk Project

• Still a bit clunky but it works

• http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Headless_Designer_Wiki

• 2 Options for running– Single Command

– Command File (Multiple commands)

• Built NSF can only end up in the Notes Data Folder (not in subdirectory)

Page 44: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Requirements on machine• Domino Designer 9.0.1

• NOTES.INI entry – DESIGNER_AUTO_ENABLED=true

• Notes ID with NO PASSWORD

• Check Source Control preferences

• Maybe add Notes Program directory to PATH environment variable so you can run ‘designer’ from anywhere

• Disable any dialogs that prompt on start-up and shutdown

Page 45: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Setting No Password

Page 46: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Source Control Preferences

Page 47: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Disable Shutdown Prompts

Page 48: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Disable Replication on Startup / Shutdown

Page 49: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Single Command Example • Format:

designer –RPARAMS –vmargs –Dcom.ibm.designer.cmd=[singlecommand]

• [singlecommand] =“[clean],[exit],[file name],[job name],[file path],[file name]”

• designer –RPARAMS –vmargs -Dcom.ibm.designer.cmd=“true,true,Headless.nsf,importandbuild,C:\AUSLUG\Headless\.project,Headless.nsf’

Page 50: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

DEMO HEADLESS DESIGNER

Page 51: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Designer Launches

Page 52: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Designer Minimizes

Page 53: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

You can maximize it manually

Page 54: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Click Progress Icon to Monitor

Page 55: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Oh no – Designer doesn’t have latest plugins

Page 56: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

INSTALL LATEST PLUGINSTRY AGAIN

Page 57: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Good – No problem now

Page 58: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Plugin management for Headless Designer• Wiki previously mentioned some ‘Headless’ commands that auto installed /

removed plugins

• Removed in version 27 of Wiki article

• Read version 26 to see them

• Probably still work?

• I haven’t tried yet

Page 59: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

A Minor Problem

• Most build tasks will let you know when they finish and whether success or fail

• Headless Designer has short attention span

• designer.exe actually starts notes2.exe in parallel and then shuts down

• Need a way to monitor when notes2 shuts down

• Egor Margineanu @egmar came up with a Powershell script to do so– http://www.egmar.ro/blog/2014/02/10/using-continous-integration-in-xpages-projects/

Page 60: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Powershell script• Erases previous HEADLESS0.log file

• Launches Headless Designer

• Finds the ‘notes2’ process

• Waits until the notes2 process has exited

Page 61: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Jenkins Installation Notes• Jenkins can be installed as Service or started as normal application

• I had trouble running Headless Designer when installed as service– Others have said it works for them if they tick ‘Service can interact with desktop’

• Instead I launch Jenkins from a logged in user

Page 62: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

BUILDING OSGI PLUGINS WITH PDE BUILD

Page 63: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Building Plugins != Building Java• OSGi plugins are complicated

• Bundles need to ‘resolve’ dependencies

• Eclipse has PDE Build– Can build using Eclipse UI

– Can also build Headless

Page 64: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Plugins, Features and Update Sites

PluginsPluginA

PluginB

PluginC

FeaturesFeature A• Plugin A

Feature B• Plugin A• Plugin B

Feature C• Plugin C

Page 65: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Building Normal Java • Java Runtime Environment

• Classpath

• javac!

Page 66: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Building OSGi Plugins• Java Runtime Environment

• Target Platform (Other OSGi plugins)

• Your Plugin(s) Source Code

• A Feature Project pointing to your plugins

Page 67: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Manually Building Plugins• Create Feature Project

– Add Plugins to feature

• Create Update Site Project– Add Features to Update Site

• Build Update Site

Page 68: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Page 69: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

After running Build All

Page 70: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

What do you need to build Domino OSGi Plugins• Eclipse for RCP and RAP Developers

– Eclipse.org, latest version is ‘Luna’

• Source Code of your plugins

• A Feature Project which specifies the plugins that are to be built

• Your Target Platform (all the other Plugins will be co-located)

• Your Target Java Runtime Environment (all the jars on the bootclasspath)– We run our headless builds on a development server that has a Domino instance

• A Build Configuration directory

• A Build Directory

Page 71: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Headless Eclipse

• http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Ftasks%2Fpde_customization.htm

Page 72: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Build Properties Template

<eclipse>/plugins/org.eclipse.pde.build_<version>/templates/headless-build

Page 73: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Automated Building of Features• Basic Setup

– Create a Build Configuration Directory in your project

– Copy the build.properties template file to your build configuration dir

– Modify build.properties as needed

• buildDirectory property specifies the directory to perform build in

• Before Each ‘Build’– Wipe BuildDirectory clean

– Copy Source of Plugins and feature into Build directory

– Structure is

• <buildDirectory>\plugins\<your plugin projects here>

• <buildDirectoyr>\features\<your feature project here>

Page 74: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Builder Configuration Properties

• http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Freference%2Fpde_builder_config.htm&anchor=fetchControl

Page 75: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Build.Properties for Domino Plugins – in a Nutshell

• Please Build feature ‘X.Y.Z’

• Please do not to download Source from CVS

• We are not creating a ‘Product’ so don’t run the packager

• Please make plugins and features into Jars

• By the way this is our:– Runtime Environment ( jar’s that are on the boot class path),

• these are the jars in <domino/jvm/* subfolders

– Target Platform (Plugins that our plugins would like to play with)

• These are the plugins in

– <domino>/osgi/rcp/eclipse– <domino>/osgi/shared/eclipse– Any other plugins that are depended on

Page 76: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Running the build• Eclipse contains an embedded ‘ant’

• This command invokes the embedded ‘ant’ and tells it to use the pde build build.xml file– <eclipse> = Eclipse Directory

– <v> = Version number

java -jar <eclipse>/plugins/org.eclipse.equinox.launcher_<v>.jar -application org.eclipse.ant.core.antRunner -buildfile <<eclipse>/plugins/org.eclipse.pde.build_<v>/scripts/build.xml> -Dbuilder=<path to the build configuration folder>

Page 77: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Running build from Ant File

Page 78: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

DEPLOYMENT CONSIDERATIONS

Page 79: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

What to do with Built NSF and Plugins?• Copying NSF to Server

• Refreshing Designs– Set template name on built nsf

– Set template inheritance of target nsf

– Refresh design

• Single Copy Xpage Design

• Restarting Http

Page 80: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Page 81: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

BuildXPages • Ant Library of tasks for use in deploying and building Xpages apps

• Uses Java Native Access to make calls to Notes C Api

• Only tested on Windows! But give it a try

• Tasks include– Setting Template Names (inherit from, is master, Single Copy Xpage)

– Copy NSF to server from Local Filesystem

– Deletensf

– Generate Site Xml for plugins

Page 82: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Generating a Site.xml• Site.xml file is needed to import plugins and features

• PDE Headless build only generates plugins and features, not site.xml

• Need to generate site.xml yourself

Page 83: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

NSF Update Site• By Default you must manually import to NSF Update Site

• Karsten Lehmann made slight modification to allow ‘Headless’ import

• http://www.openntf.org/main.nsf/project.xsp?r=project/Open%20Eclipse%20Update%20Site

Page 84: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Conclusion

• If you want to automate some Build Processes you can

• It is fiddly to set up but once you have it there it works

• Contact me if you have any questions!

Page 85: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

APPENDIX ANotes on Build Properties for OSGi Headless Build

Page 86: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Notes on Build.Properties

• topLevelElementId would correspond to the feature which defines the plugins to build

• <BuildDirectory>/features/com.your.feature.id/

Property Value

topLevelElementType feature

topLevelElementId com.your.feature.id

Page 87: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Notes on Build.Properties

• The Packager is used when building a whole ‘Rich Client Platform’ product– E.g. Eclipse, IBM Notes, IBM Domino Designer are Rich Client Platform Products

• We are not building a ‘Product’ we are only building plugins

Property Value

runPackager false

Page 88: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Notes on Build.Properties

• PDE build has an in-built mechanism to ‘fetch’ Source from CVS

• Keep these set to true to avoid any CVS operations

Property Value

skipFetch true

skipMaps true

Page 89: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Notes on Build.Properties

• outputUpdateJars will generate the plugins and features as ‘.jar’ files– if set to false, features will not be made into ‘jar’ files

– if set to false, plugins with ‘unpack the plug-in archive after the installation’ will not be made into ‘jar’ files

– If you plan on loading into an Update site I recommened setting to ‘true’

• resolution.devMode may be needed to be used to allow for less strict validation of bundle dependencies

Property Value

outputUpdateJars true

resolution.devMode true

Page 90: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Notes on Build.Properties

• PDE Build matches the Execution Environment in the Plugin Manifest, to the related property in build.properties

• These Jars form the ‘boot class path’

• skipBase tells

Property Value

JavaSE-1.6 List of all jars from <domino>/jvm and subdirectories

skipBase true

Page 91: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Notes on Build.Properties

• pluginPath is a list of folders which contain features/ and plugins/– This is equivalent to your ‘Target Platform’

– By Default you will have

• <dominoProgDir>/osgi/rcp/eclipse

• <dominoProgDir>/osgi/shared/eclipse

– You could also include other 3rd party plugin dependencies

• <someotherDir>/someproject/eclipse

Property Value

pluginPath List of Eclipse Plugin folders

Page 92: Build automation for XPages - AUSLUG 2015

June 11th & 12th, Melbourne, AustraliaMeet.Share.Learn.Connect @AusLUG #@Inform2015

Notes on Build.Properties

• If you are building plugins for production, then you may want javacDebugInfo to be false

• If you are building plugins and want to ‘Remote Java Debug’ them, you will need line numbers included, and should set javacDebugInfo to true

Property Value

javacDebugInfo true or false

compilerArg -g