How to run source in gitlab ci / cd for OpenFoam?

mkdir OpenFOAM cp -r /opt/OpenFOAM/OpenFOAM-v1812/ OpenFOAM/
ls OpenFOAM/OpenFOAM-v1812/ Allwmake BuildIssues.txt COPYING META-INFO applications bin doc etc modules platforms site src tutorials wmake source OpenFOAM/OpenFOAM-v1812/etc/bashrc WM_LABEL_SIZE=64
ERROR: Job failed: exit code 1

Hi, maybe I’m late and you already figured out. In any case it seems that the OpenFOAM bashrc file is somehow bugged, at least on Docker, and it returns an exit code different than 1 even if it seems being sourced correctly. So to workaround the problem you only need to force the exit code to 0 when sourcing the bashrc:

    - source /opt/openfoam6/etc/bashrc || true

A full MWE:

image: cfdengine/openfoam

    DEBIAN_FRONTEND: noninteractive

# This job test the compilation
        - sudo apt-get update
        - sudo apt-get -y install build-essential
        - . /opt/openfoam6/etc/bashrc || true
        - ./Allwmake