Skip to content
Snippets Groups Projects
buildimage.sh 827 B
Newer Older
  • Learn to ignore specific revisions
  • ##/bin/bash
    
    maritn's avatar
    maritn committed
    # arg1: sbcl version
    # arg2: maxima version
    # arg3: stack or moodle version: "stack-XXX" or "moodlev.X"
    # arg4: LIB_PATH
    # arg5: REGISTRY IP
    #
    echo "starting to build image for:"
    
    echo "sbcl: $1"
    echo "maxima: $2"
    echo "stack: $3"
    
    maritn's avatar
    maritn committed
    # tag the image
    
    IMAGENAME="$5/goemaxima:$3"
    
    maritn's avatar
    maritn committed
    # check if the image already exists on the server
    
    docker pull "${IMAGENAME}"
    
    maritn's avatar
    maritn committed
    # build it
    
    if [ "$stack" = "2017121800" ]; then
    	docker build -t "${IMAGENAME}" --build-arg MAXIMA_VERSION="$2" --build-arg SBCL_VERSION="$1" --build-arg LIB_PATH="$4" --build-arg "/opt/maxima/assets/maximalocal.mac" . || exit 1
    else
    	docker build -t "${IMAGENAME}" --build-arg MAXIMA_VERSION="$2" --build-arg SBCL_VERSION="$1" --build-arg LIB_PATH="$4" . || exit 1
    fi
    
    echo "${IMAGENAME} wurde erfolgreich gebaut."
    
    maritn's avatar
    maritn committed
    # testing?
    # push it
    
    docker push "${IMAGENAME}"
    
    maritn's avatar
    maritn committed