-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
100 lines (94 loc) · 2.69 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
variables:
DEBIAN_FRONTEND: noninteractive
APT_GET_INSTALL: "apt-get install --no-install-recommends -q -y"
stages:
- pre
- build
- deploy
pre-commit:
stage: pre
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
# install necessary packages:
- apk add --no-cache bash gcc git libc-dev npm py3-pip python3-dev
- pip3 install pre-commit
- pre-commit --version
- pre-commit run --all-files
pycodestyle:
stage: pre
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
- apk add --no-cache py3-pycodestyle
# check PEP 8 code style (pycodestyle was formerly called pep8)
- pycodestyle --version
- pycodestyle --show-source --show-pep8 --statistics $(find -name "*.py")
build_pages:
stage: build
image:
# https://hub.docker.com/_/debian
name: debian:latest
script:
- date
- apt-get update
# get and install necessary packages:
- $APT_GET_INSTALL latexmk make python3-sphinx rsync texlive-fonts-recommended texlive-latex-extra texlive-latex-recommended
# build
- ./create_doc
# create data for pages:
- mv riaf.html public
- mv riaf.pdf public/
# create badges, which could be used in gitlab:
- $APT_GET_INSTALL python3-pip
# see https://github.com/jongracecox/anybadge for available colors
- pip3 install anybadge
- anybadge -l "document as" -v html -f pages.svg -c fuchsia -o
- anybadge -l "document as" -v pdf -f document_pdf.svg -c orange -o
- anybadge -l "source" -v code -f source_code.svg -c lightgrey -o
# store data as artifacts (e. g. used by pages):
artifacts:
expire_in: 1 hrs
paths:
- document_pdf.svg
- pages.svg
- public
- source_code.svg
pages:
stage: deploy
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
dependencies:
- build_pages
script:
- date
# store data as artifacts (e. g. used by pages):
artifacts:
paths:
- document_pdf.svg
- pages.svg
- public
- source_code.svg
deploy_to_github:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_SERVER_HOST == "gitlab.com"
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
- apk add --no-cache git openssh
- mkdir ~/.ssh && chmod 700 ~/.ssh
- ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- mv $github_deploy_key ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
- repopath=$(mktemp -d)
- git clone --mirror ${CI_REPOSITORY_URL} $repopath
- (cd $repopath && git push --prune --mirror git@github.com:dlr-pa/riaf.git)