diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 943876243c3ec9145b39f4a205111a04d1b51e03..b910baa7d68a72107a9066dd3b24b1c841929d10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,51 +1,99 @@ +# docker packages +image: registry.gitlab.com/islandoftex/images/texlive:TL2021-historic + + +workflow: + # avoid to trigger pipeline for each commit + # pipeline should be triggered using https://forge.nemo-ocean.eu/nemo/doc/manuals/-/pipelines/new + rules: + - if: $CI_PIPELINE_SOURCE == 'web' + - if: $CI_PIPELINE_SOURCE == 'schedule' + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_COMMIT_TITLE =~ /(?i).*\[ci\].*/ + + variables: - GIT_SUBMODULE_STRATEGY: recursive + MANUALS: + description: "Manual(s) to be built" + value: "all" + options: + - "all" + - "NEMO" + - "SI3" + - "TOP" # input version for release (available only when pipeline is run manually) + DRAFT_MODE: + description: "Enable/disable latex draft mode (faster rendering without figures)" + value: "yes" + options: + - "yes" + - "no" + DEBUG_MODE: + description: "Print or not latex compilation details in log file for debugging" + value: "no" + options: + - "yes" + - "no" VERSION: value: "" description: "Set version release number for manuals" + GIT_SUBMODULE_STRATEGY: recursive + + +before_script: + - if [[ ${DRAFT_MODE} == "no" ]]; then BUILD_OPT="-p"; fi + - if [[ ${DEBUG_MODE} == "yes" ]]; then BASH_OPT="-x"; fi -# docker packages -image: registry.gitlab.com/islandoftex/images/texlive:TL2021-historic NEMO manual: tags: - docker stage: build - #when: manual + rules: + - if: ($MANUALS == "NEMO" || $MANUALS == "all") script: - - version=${CI_COMMIT_REF_NAME} - - if [ "x${VERSION}" != "x" ] ; then version=${VERSION} ; fi - - bash -x manual_build.sh -r ${version} -p NEMO + - bash ${BASH_OPT} manual_build.sh ${BUILD_OPT} -r ${VERSION:-CI_COMMIT_REF_NAME} NEMO artifacts: paths: - NEMO_manual.pdf expire_in: 15 mins + +SI3 manual: + tags: + - docker + stage: build + rules: + - if: ($MANUALS == "SI3" || $MANUALS == "all") + script: + - bash ${BASH_OPT} manual_build.sh ${BUILD_OPT} -r ${VERSION:-CI_COMMIT_REF_NAME} SI3 + artifacts: + paths: + - SI3_manual.pdf + expire_in: 15 mins + + TOP manual: tags: - docker stage: build - #when: manual + rules: + - if: ($MANUALS == "TOP" || $MANUALS == "all") script: - - version=${CI_COMMIT_REF_NAME} - - if [ "x${VERSION}" != "x" ] ; then version=${VERSION} ; fi - - bash -x manual_build.sh -r ${version} -p TOP + - bash ${BASH_OPT} manual_build.sh ${BUILD_OPT} -r ${VERSION:-CI_COMMIT_REF_NAME} TOP artifacts: paths: - TOP_manual.pdf expire_in: 15 mins -SI3 manual: + +# generic job (needs to be parallelized) +.build_manual: tags: - docker stage: build - #when: manual script: - - version=${CI_COMMIT_REF_NAME} - - if [ "x${VERSION}" != "x" ] ; then version=${VERSION} ; fi - - bash -x manual_build.sh -r ${version} -p SI3 + - bash ${BASH_OPT} manual_build.sh ${BUILD_OPT} -r ${VERSION:-$CI_COMMIT_REF_NAME} ${MANUALS} artifacts: paths: - - SI3_manual.pdf - expire_in: 15 mins + - ./*_manual.pdf + expire_in: 15 mins \ No newline at end of file