Please check gitlab-tutorial

Skip to content
Snippets Groups Projects
Select Git revision
  • 2cb5cf300f5db170f9c6f0658fd282b29a5b33e6
  • master default protected
  • 4-add-auto-changelog
  • 04718d1e
  • 2e2f7ce3
  • d29bf3a1
  • v1.0.4
  • c40fe86a
  • f898ebf4
  • v1.0.3
  • v1.0.2
  • v1.0.1
  • v1.0.0
13 results

.gitlab-ci.yml

Blame
  • .gitlab-ci.yml 3.21 KiB
    # To contribute improvements to CI/CD templates, please follow the Development guide at:
    # https://docs.gitlab.com/ee/development/cicd/templates.html
    # This specific template is located at:
    # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/LaTeX.gitlab-ci.yml
    
    ---
    #variables:
      # Feel free to choose the image that suits you best.
      # blang/latex:latest ... Former image used in this template. No longer maintained by author.
      # listx/texlive:2020 ... The default, referring to TexLive 2020. Current at least to 2021-02-02.
    
      # Additional alternatives with high Docker pull counts:
      # thomasweise/docker-texlive-full
      # thomasweise/texlive
      # adnrv/texlive
    #  LATEX_IMAGE: listx/texlive:2020
    
    stages:
      - build
      - release
    
    build-windows:
      stage: build
      tags:
        - windows
        - latex
      before_script:
        - echo $CI_JOB_ID
        # Writing GE_JOB_ID variable to environment file, will need the value in the next stage.
        #- echo BUILD_JOB_ID=$CI_JOB_ID >> variables.env
        - Add-Content -Path variables.env -Value "BUILD_JOB_ID=$CI_JOB_ID"
      script:
        # prepare all possible variants of the thesis
        - (Get-Content ./Example.tex -Raw) -Replace 'ThesisType.=.{\w*}', 'ThesisType = {SEM}' | Set-Content ./Example_SEM.tex
        #- (Get-Content ./Example.tex -Raw) -Replace 'ThesisType.=.{\w*}', 'ThesisType = {PA}' | Set-Content ./Example_PA.tex
        #- (Get-Content ./Example.tex -Raw) -Replace 'ThesisType.=.{\w*}', 'ThesisType = {BA}' | Set-Content ./Example_BA.tex
        #- (Get-Content ./Example.tex -Raw) -Replace 'ThesisType.=.{\w*}', 'ThesisType = {MA}' | Set-Content ./Example_MA.tex
        #- (Get-Content ./Example.tex -Raw) -Replace 'ThesisType.=.{\w*}', 'ThesisType = {PHD}' | Set-Content ./Example_PHD.tex
        # remove Example.tex - no need to compile it now
        - rm ./Example.tex
        - rm ./Example.pdf
        # compile all .tex files
        - latexmk -pdf
      artifacts:
        paths:
          - "*.pdf"
        reports:
          # To ensure we've access to this file in the next stage
          dotenv: variables.env
    
    release-windows:
      stage: release
      tags:
        - windows
        - latex
      needs:
        - job: build-windows
          artifacts: true
      #rules:
      #  - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # only do a release on commits or merges to the master branch 
      variables:
        TAG: '$CI_COMMIT_SHORT_SHA'
      script:
        - echo "Create Release $TAG"
        - echo $JOB_ID  
      release:
        name: 'Release $TAG'
        tag_name: '$TAG'
        ref: '$TAG'
        description: 'Release $TAG'