Skip to content
Snippets Groups Projects
Select Git revision
  • dfe99a07caa5451649c2efaa1e4f945f01def1b4
  • master default protected
  • repo-cleanup
  • remove-oracle
  • patch-1
  • feature/UpdateOfPandocImage
  • develop
  • unicode-file-tree
  • psql93extensions
  • v1.0
10 results

.gitlab-ci.yml

Blame
  • .gitlab-ci.yml 3.68 KiB
    variables:
      PANDOC_IMAGE: gitlab.dev.ifs.hsr.ch:45023/ifs/gitlabmarkdowntopdf/pandoc:v1.5
    
    stages:
    - build
    
    before_script:
    
    .job_template: &job_definition
      image: $PANDOC_IMAGE
      stage: build
      variables: &job_common_vars
        LANG: en_US.utf8
        MaxDepth: "1"
        SourceFiles: "NotThere.Md"
        GIT_CHECKOUT: "false"
        FileOutputDir: $CI_PROJECT_DIR
      tags:
      - docker
      script:
      # do not fetch lfs content for docu jobs, change if job requires lfs files
      - git config --global --remove-section filter.lfs || true
      - export JOB_DIR=${JOB_DIR:-${CI_JOB_NAME/-Solutions/}}
      - git config core.hooksPath hooks/
      # checkout again to execute custom git-hooks
      - git checkout -f $CI_COMMIT_SHA
      - git clean -dxf
      - git archive -o ${FileOutputDir}/${CI_JOB_NAME}.zip HEAD
      - >
        for n in $(find $JOB_DIR -maxdepth $MaxDepth "(" -name $SourceFiles -o -iname README.md ")" -print ); do
        echo $n;
        fn=$(basename $n);
        ( cd $(dirname $n) &&
        pandoc -f markdown+emoji
        -t latex
        --pdf-engine=xelatex
        --template=hsrtemplate
        --filter=gfm_cleanup.py --filter=gitlab_links.py
        --filter=plantuml.py --filter=svg_convert.py
        -Vdate=$(date "+%Y-%m-%d")
        -o $CI_PROJECT_DIR/${CI_JOB_NAME}.pdf $fn $CI_PROJECT_DIR/pandoc_meta.yaml ) &
        done;
        wait;
      - >
        for n in $(find $JOB_DIR -maxdepth $MaxDepth "(" -name $SourceFiles -o -iname README.md ")" -exec grep -q "SOLUTION" {} \; -print ); do
        echo $n;
        fn=$(basename $n);
        ( cd $(dirname $n) &&
        pandoc -f markdown+emoji
        -t latex
        --pdf-engine=xelatex
        --template=hsrtemplate --filter=inline_solutions.py
        --filter=gfm_cleanup.py --filter=gitlab_links.py
        --filter=plantuml.py --filter=svg_convert.py
        -Vdate=$(date "+%Y-%m-%d") -Vsolution=1
        -o $CI_PROJECT_DIR/${CI_JOB_NAME}-Solutions.pdf $fn $CI_PROJECT_DIR/pandoc_meta.yaml ) &
        done;
        wait;
      artifacts:
        #expire_in: 3 mos
        paths:
        - ${FileOutputDir}/${CI_JOB_NAME}*.pdf
        - ${FileOutputDir}/${CI_JOB_NAME}.zip
    
    AngProj:
      <<: *job_definition
      variables:
        <<: *job_common_vars
        JOB_DIR: '.'