#!bash -lex
cd "$WORKSPACE"
# Set environment ============================================================
ZIP_FILTER='*'
if [ "$OS" == "win" ]; then
�� �� set -e # Stop the execution if a command fails!
�� �� ZIP_FILTER=' *.exe *.dll'
fi
# Download the latest sources ================================================
# Unpack sources =============================================================
tar -xzf cog.tar.gz || echo # echo needed for Windows build (error on symlinks creation)
mkdir -p cog/build
mkdir -p cog/image
cd cog/image
unzip -o ../../vmmaker-image.zip
# Generate sources ===========================================================
echo "
PharoVMBuilder buildOnJenkins: '$OS'.
Smalltalk snapshot: false andQuit: true." > ./script.st
./pharo generator.image script.st || (cat stderr; exit 1)
cd ../../
tar -czf sources.tar.gz -C cog .
# Compile ====================================================================
cd cog/build
sh build.sh
# Archive ====================================================================
cd "$WORKSPACE/cog/results"
zip -r "vm.zip" $ZIP_FILTER
cp -f vm.zip ../../"${BUILD_NUMBER}.zip"
cp -f vm.zip ../../"latest.zip"
mv -f vm.zip ../../"Pharo-VM-${OS}-latest.zip"
# success
exit 0