ci/ci-pharo-common.sh
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 09 Nov 2015 00:38:23 +0000
changeset 550 777f3813febc
parent 549 8ad6734770cd
child 553 d83cb4945d5e
permissions -rw-r--r--
Fixed CI scripts for PetitParser.

#
# A set of functions to be used in PetitParser's Pharo CI jobs
#

if [ ! -x "ci-common.sh" ]; then
    wget -O "ci-common.sh" https://bitbucket.org/janvrany/stx-goodies-petitparser/raw/tip/ci/ci-common.sh
fi
. ci-common.sh


IMAGE_BASE=PetitParser-$BUILD_NUMBER
IMAGE=$IMAGE_BASE.image

# A function to download Pharo. The version of Pharo 
# is taken from environment variable PHARO. If it's not
# defined, defaults to  Pharo 5.0 
function ci_pharo_download_pharo {
    if [ -z "$PHARO" ]; then
        PHARO=5.0
    fi

    if [ ! -x pharo-ui ]; then
        rm -rf pharo pharo-ui pharo-vm
        wget -O- http://swing.fit.cvut.cz/download/pharo/vm-swing | bash
    fi

    if [ ! -r Pharo.image ]; then
        rm -rf Pharo.image Pharo.changes
        if [ "$PHARO" == "3.0" ]; then
            wget -O- get.pharo.org/30 | bash
        elif [  "$PHARO" == "4.0"  ]; then
            wget -O- get.pharo.org/40 | bash
        elif [  "$PHARO" == "5.0"  ]; then
            wget -O- get.pharo.org/50 | bash   
        else
            echo "Unknown PHARO version: $PHARO"
            exit 1
        fi
    fi
}

# A function to download PetitCompiler and build an image

function ci_pharo_download_petitparser {
    ./pharo Pharo.image save $IMAGE_BASE
    ./pharo $IMAGE config http://smalltalkhub.com/mc/JanVrany/CalipeL-S/main ConfigurationOfCalipeLS --install=0.1
    ./pharo $IMAGE eval --save "

    Gofer new smalltalkhubUser: 'JanKurs' project: 'PetitParser';
        configurationOf: #PetitCompiler; load.
    (Smalltalk at: #ConfigurationOfPetitCompiler) perform: #'loadDevelopment'.
    "
}