Home

Awesome

PART A - Prepare image and adjust build scripts

Install the support scripts, either by downloading the latest code directly from GitHub http://github.com/renggli/builder/zipball/master or by cloning the Git repository:

git clone git://github.com/renggli/builder.git

You should get a directory structure with several empty directories, this readme file and several shell scripts.

  1. Get a distribution image from http://www.pharo-project.org/pharo-download and unzip the image in the "images" directory. You can also script that in your initial build-step and fetch the official stable images from http://pharo-project.org/pharo-download/stable-core or http://pharo-project.org/pharo-download/stable.

  2. Review or create your own build scripts in the directory "scripts". Use whatever loader you want: Gofer, Metacello, Mason, ... There are two special scripts, "before.st" is run prior to any build and "after.st" is run after any build. Make sure that the last action of the "after.st" script saves and quits the image. The other scripts load stuff and set settings. The sample builds scripts are a good starting point for creating your own build scripts for your own projects.

  3. The "cache" directory contains the package cache of the builds. It is initially empty.

  4. The "builds" directory is only used when the build script is called from the command-line. When used from Jenkins it remains empty.

  5. The "sources" directory contains the .sources files that your images might need. Available sources files are linked to the build directory if present.

  6. The "oneclick" directory contains a template for building oneclick images. "oneclick-icons" contains a collection of icons to be used with the oneclick images.

The generic build script build.sh works on this directory structure. Also the other shell scripts expect the structure like this. Preferably these scripts are called from Jenkins, but you can also call it from the command line. build.sh takes 3 kinds of arguments, an input image name, an output image name, and a series of scripts to load into that image. See the help for details.

Similary build-oneclick.sh takes and input image and builds a one-click image from it. Run the script without any arguments to get a listing of supported settings.

PART B - Integrate with Jenkins

Add new Jenkins job

Configure the new job

Run the build job

DEBUGGING

  1. Test your build scripts in a headful image beforehand.

  2. In case of problems study the "Console Output" of the failed build.

  3. In most cases builds fail because of an error within the image. Click on "Workspace" and check "PharoDebug.log".

  4. If the build stalls abort it and study the "Console Output" to figure out what went wrong.

JENKINS PLUGINS