2021-05-16 20:01:36 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build
|
|
|
|
|
|
|
|
steps:
|
2021-10-12 10:15:03 +00:00
|
|
|
- name: pandoc
|
2021-11-10 12:33:51 +00:00
|
|
|
pull: always
|
|
|
|
image: kingofdog/pandoc-latex:latest
|
2021-10-12 10:15:03 +00:00
|
|
|
commands:
|
|
|
|
- ./build.sh pandoc
|
2021-11-10 12:33:51 +00:00
|
|
|
- name: prepare-files
|
|
|
|
image: kingofdog/pandoc-latex:latest
|
|
|
|
commands:
|
2021-10-12 10:15:03 +00:00
|
|
|
- ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA`
|
2021-11-10 12:33:51 +00:00
|
|
|
- cp out/main.pdf "$(date +"%F-%H-%M")_${DRONE_REPO_NAME}_${DRONE_BUILD_NUMBER}.pdf"
|
2022-09-14 07:50:26 +00:00
|
|
|
- cp out/main.pdf "${DRONE_REPO_NAME}_${DRONE_BRANCH}.pdf"
|
2021-11-10 12:33:51 +00:00
|
|
|
depends_on:
|
|
|
|
- pandoc
|
|
|
|
- name: log
|
|
|
|
image: kingofdog/pandoc-latex:latest
|
|
|
|
commands:
|
|
|
|
- cat out/main.log
|
|
|
|
- ls -l out
|
|
|
|
- ls -l appendix/generated
|
|
|
|
depends_on:
|
|
|
|
- pandoc
|
2021-10-12 10:15:03 +00:00
|
|
|
- name: upload
|
|
|
|
image: plugins/s3
|
|
|
|
settings:
|
2021-11-10 12:33:51 +00:00
|
|
|
bucket:
|
|
|
|
from_secret: minio_bucket
|
2021-10-12 10:15:03 +00:00
|
|
|
access_key:
|
|
|
|
from_secret: minio_access_key
|
|
|
|
secret_key:
|
|
|
|
from_secret: minio_secret_key
|
|
|
|
source: ./*.pdf
|
|
|
|
region: eu-dogland
|
2022-09-14 07:50:26 +00:00
|
|
|
target:
|
|
|
|
from_secret: minio_target
|
2021-10-12 10:15:03 +00:00
|
|
|
path_style: true
|
|
|
|
endpoint: https://minio.kingofdog.de
|
2021-11-10 12:33:51 +00:00
|
|
|
depends_on:
|
|
|
|
- prepare-files
|
2021-10-12 10:15:03 +00:00
|
|
|
- name: release
|
|
|
|
image: plugins/gitea-release
|
|
|
|
settings:
|
|
|
|
api_key:
|
|
|
|
from_secret: gitea_token
|
|
|
|
base_url: https://git.kingofdog.de
|
|
|
|
files: ./*.pdf
|
|
|
|
when:
|
2021-11-10 12:33:51 +00:00
|
|
|
event: tag
|
|
|
|
depends_on:
|
|
|
|
- prepare-files
|
|
|
|
- name: hunspell_chapters
|
|
|
|
image: kingofdog/hunspell:latest
|
|
|
|
failure: ignore
|
|
|
|
commands:
|
|
|
|
- sed -i -E 's/\\acf?s?p?\{([^}]+)\}/\1/g' chapter/out.tex
|
|
|
|
- sed -i -E 's/\\\w+\{[^}]+\}//g' chapter/out.tex
|
|
|
|
- export HUNSPELL_FINDINGS="`hunspell -l -i UTF-8 -d de_DE_frami,en_US -p ./.hunspellignore chapter/out.tex | sort | uniq`"
|
|
|
|
- export HUNSPELL_FINDINGS_COUNT=`echo $HUNSPELL_FINDINGS | wc -w`
|
|
|
|
- echo "Found $HUNSPELL_FINDINGS_COUNT different incorrect words."
|
|
|
|
- '[ -z "$HUNSPELL_FINDINGS" ] && exit 0 || exit 1'
|
|
|
|
depends_on:
|
|
|
|
- pandoc
|
|
|
|
- name: hunspell_appendix
|
|
|
|
image: kingofdog/hunspell:latest
|
|
|
|
failure: ignore
|
|
|
|
commands:
|
|
|
|
- export HUNSPELL_FINDINGS=`for filename in appendix/*.tex; do hunspell -l -d de_DE_frami,en_US -p ./.hunspellignore -t $filename; done | sort | uniq`
|
|
|
|
- echo $HUNSPELL_FINDINGS
|
|
|
|
- '[ -z "$HUNSPELL_FINDINGS" ] && exit 0 || exit 1'
|
|
|
|
depends_on:
|
|
|
|
- pandoc
|