image: michaellundquist/rmtoobase:latest

# to make this faster, setup a custom runner for it (and tag it) that caches the image

variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - /var/cache/apt/archives/
    - ./downloads

before_script:
    # copy rmtoo's default Makefile and setenv.sh if the repo doesn't have them.
    - if ! test -f "./setenv.sh"; then cp /usr/share/doc/rmtoo/contrib/template_project/setenv.sh .; fi
    - source ./setenv.sh DEB
    - if ! test -f "./Makefile"; then cp ${RMTOO_CONTRIB_DIR}/rmtoo/contrib/template_project/Makefile .; fi
    
createArtifacts:
    stage: build
    #tags: rmtoo #add this in when you create a custom runner
    script:
        - make clean
        - make
        - ls artifacts
    artifacts:
        name: "$CI_JOB_NAME"
        paths:
            - ./artifacts/*
        expire_in: 3 weeks and 2 days
