Skip to content
Snippets Groups Projects
Commit 2dcdeabf authored by Chessmaster's avatar Chessmaster
Browse files

Merge branch 'version_ci' into 'master'

Tagging PDFs before publishing

See merge request !7
parents 679b03b7 8fc56a4e
Branches master
No related merge requests found
......@@ -2,27 +2,41 @@ stages:
- build
- publish
build_guide:
.template:build_guide:
stage: build
image: alpine
script:
before_script:
- apk update
- apk add ruby asciidoctor
- apk add --no-cache ruby asciidoctor git
- gem install asciidoctor-pdf --pre
- asciidoctor-pdf -o angelguide_en.pdf guide.adoc
- asciidoctor-pdf -a lang=de -o angelguide_de.pdf guide.adoc
artifacts:
paths:
- "angelguide_en.pdf"
- "angelguide_de.pdf"
expire_in: 12 months
build_guide_by_tag:
extends: .template:build_guide
script:
- ./build.sh $CI_COMMIT_TAG
rules:
- if: $CI_COMMIT_TAG != null
when: always
build_guide:
extends: .template:build_guide
script:
- ./build.sh $CI_COMMIT_SHORT_SHA
rules:
- if: $CI_COMMIT_TAG == null
when: always
publish_guide:
stage: publish
image: kroniak/ssh-client
before_script:
- apk update
- apk add rsync
- apk add --no-cache rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
......@@ -32,6 +46,6 @@ publish_guide:
script:
- 'rsync -av angelguide_*.pdf $PUBLISH_USER@$PUBLISH_HOST:$PUBLISH_PATH'
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
- if: '$CI_COMMIT_REF_NAME == "master" && $CI_COMMIT_TAG != null'
when: on_success
- when: never
build.sh 0 → 100755
#!/bin/sh
if [[ $# -ne 1 ]]; then
echo expected revision as option >&2
exit 1
fi
revision="$1"
commit_date=$(git show -s --format=%ci ${revision} | cut -c1-10)
asciidoctor-pdf -a revnumber=${revision} -a revdate=${commit_date} -o angelguide_en.pdf guide.adoc
asciidoctor-pdf -a revnumber=${revision} -a revdate=${commit_date} -o angelguide_de.pdf -a lang=de guide.adoc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment