This repository has been archived by the owner on Mar 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
85 lines (68 loc) · 1.65 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
image: $CI_REGISTRY/abgabesystem/docker-abgabesystem:latest
variables:
REFERENCE_SOLUTION: $CI_PROJECT_NAMESPACE/solutions/solutions
JPLAG_PATH: /app/jplag.jar
CI_REPO_HOST: $CI_REGISTRY
stages:
- test
- doc
- projects
- deadline
- plagiates
before_script:
## get ssh private key from secret variable
- echo "$SSH_PUBLIC_KEY" | tr -d '\r' > deploy_key.pub
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-add -l
- ssh-keyscan $CI_REPO_HOST | tee ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
## get API token from secret variable
- ./tools/build-config.sh
- cp python-gitlab.cfg $HOME/.python-gitlab.cfg
- python3 setup.py install
deadlines:
## creates the pushed tag inside all projects
stage: deadline
tags:
- abgabesystem
script:
- abgabesystem deadline -t $CI_COMMIT_REF_NAME -r $REFERENCE_SOLUTION
only:
- tags
plagiates:
## creates checkout of the tag for all projects and runs plagiarism checker
stage: plagiates
tags:
- abgabesystem
script:
- mkdir -p results
- abgabesystem plagiates -t $CI_COMMIT_REF_NAME -r $REFERENCE_SOLUTION -j $JPLAG_PATH
artifacts:
paths:
- results/
only:
- tags
doc:
## creates html documentation
stage: doc
tags:
- abgabesystem
script:
- cd docs && make html
artifacts:
paths:
- doc/_build/html/
only:
- master
create_projects:
## create projects for all enrolled students
stage: projects
tags:
- abgabesystem
script:
- abgabesystem projects -c $CI_PROJECT_NAMESPACE -d deploy_key.pub
only:
- branches