Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TexCommon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Informatik 8
TexCommon
Commits
c329518c
Commit
c329518c
authored
6 years ago
by
Thorsten Wißmann
Browse files
Options
Downloads
Patches
Plain Diff
Add .gitlab-ci.yml
parent
4f6607ee
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#14335
passed
6 years ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+45
-0
45 additions, 0 deletions
.gitlab-ci.yml
with
45 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
45
−
0
View file @
c329518c
compile_latex
:
image
:
aergus/latex
# the docker image by aergus https://hub.docker.com/r/aergus/latex/
stage
:
build
variables
:
GIT_SUBMODULE_STRATEGY
:
recursive
script
:
# the following script requires bash
# when editing, be careful, not to use any colons since they mess up the yaml parser!
# compile all the PDFs you are interested in:
-
verb() { echo -e "\e[32;1m===== $* =====\e[0m" ; }
-
failed=( )
-
compile_tex() { latexmk -f -cd -pdf "$1" ; }
# activate the following line if you use a custom makefile
#- compile_tex() { make "${1%%.tex}.pdf" ; }
-
mapfile -t gitfiles < <(git ls-files)
-
mapfile -d $'\0' -t texfiles < <(grep -lZ -d skip --include '*.tex' -E '^[^%]*\\documentclass' "${gitfiles[@]}")
-
for t in "${texfiles[@]}" ; do verb "Compiling $t" ; compile_tex "$t" || failed+=( "$t" ) ; done
-
git ls-files -z | xargs -0 rm -v -f
# remove all tracked files such that they are not included in the artifacts
-
echo "Successful Compilation Coverage $(((${#texfiles[@]}-${#failed[@]})*10000/${#texfiles[@]}))" | sed 's/..$/\.&/'
-
if [ "${#failed[@]}" -ge 1 ] ; then verb "failed files $failed" ;
false
; fi
# the second last line in the script prints the statistics which are parsed by the following regex:
coverage
:
/^Successful Compilation Coverage [0-9]*\.[0-9][0-9]/
cache
:
untracked
:
true
# cache all pdf files for subsequent runs
artifacts
:
name
:
"
${CI_PROJECT_NAME}-pdfs"
when
:
always
expire_in
:
10 yrs
paths
:
-
./*.pdf
-
./*/*.pdf
-
./*/*/*.pdf
# You can link the most recently *finished* artifacts by a badge:
#
# Link: https://gitlab.cs.fau.de/%{project_path}/-/jobs/artifacts/%{default_branch}/browse?job=compile_latex
# Badge image URL: https://gitlab.cs.fau.de/%{project_path}/badges/%{default_branch}/build.svg
#
# e.g.: https://gitlab.cs.fau.de/thorsten/coalgpartref/-/jobs/artifacts/master/browse?job=compile_latex
# see also https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html#downloading-the-latest-artifacts
#
#environment:
# name: Recent PDFs
# url: https://gitlab.cs.fau.de/$CI_PROJECT_PATH/builds/$CI_BUILD_ID/artifacts/browse
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment