ci/ci-pharo-common.sh
changeset 549 8ad6734770cd
child 550 777f3813febc
equal deleted inserted replaced
548:5536a6da50e4 549:8ad6734770cd
       
     1 #
       
     2 # A set of functions to be used in PetitParser's Pharo CI jobs
       
     3 #
       
     4 
       
     5 if test -x "ci-common.sh"; then
       
     6     echo wget -O "ci-common.sh" https://bitbucket.org/janvrany/stx-goodies-petitparser/raw/tip/ci/ci-common.sh
       
     7 fi
       
     8 . ci-common.sh
       
     9 
       
    10 
       
    11 IMAGE_BASE=PetitParser-$BUILD_NUMBER
       
    12 IMAGE=$IMAGE_BASE.image
       
    13 
       
    14 # A function to download Pharo. The version of Pharo 
       
    15 # is taken from environment variable PHARO. If it's not
       
    16 # defined, defaults to  Pharo 5.0 
       
    17 function ci_pharo_download_pharo {
       
    18     if [ -z "$PHARO" ]; then
       
    19         PHARO=5.0
       
    20     fi
       
    21 
       
    22     if [ ! -x pharo-ui ]; then
       
    23         rm -rf pharo pharo-ui pharo-vm
       
    24         wget -O- http://swing.fit.cvut.cz/download/pharo/vm-swing | bash
       
    25     fi
       
    26 
       
    27     if [ ! -r Pharo.image ]; then
       
    28         rm -rf Pharo.image Pharo.changes
       
    29         if [ "$PHARO" == "3.0" ]; then
       
    30             wget -O- get.pharo.org/30 | bash
       
    31         elif [  "$PHARO" == "4.0"  ]; then
       
    32             wget -O- get.pharo.org/40 | bash
       
    33         elif [  "$PHARO" == "5.0"  ]; then
       
    34             wget -O- get.pharo.org/50 | bash   
       
    35         else
       
    36             echo "Unknown PHARO version: $PHARO"
       
    37             exit 1
       
    38         fi
       
    39     fi
       
    40 }
       
    41 
       
    42 # A function to download PetitCompiler and build an image
       
    43 
       
    44 function ci_pharo_download_petitparser {
       
    45     ./pharo Pharo.image save $IMAGE_BASE
       
    46     ./pharo $IMAGE config http://smalltalkhub.com/mc/JanVrany/CalipeL-S/main ConfigurationOfCalipeLS --install=0.1
       
    47     ./pharo $IMAGE eval --save "
       
    48 
       
    49     Gofer new smalltalkhubUser: 'JanKurs' project: 'PetitParser';
       
    50         configurationOf: #PetitCompiler; load.
       
    51     (Smalltalk at: #ConfigurationOfPetitCompiler) perform: #'loadDevelopment'.
       
    52     "
       
    53 }
       
    54