This repository has been archived by the owner on Sep 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
73 lines (57 loc) · 2.06 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
image: maven:latest
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
REPREPRO_BASE: "/srv/repository/ubuntu"
before_script:
- VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- ARTIFACT=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
cache:
paths:
- .m2/repository/
- target/
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS clean compile
test:
stage: test
script:
- mvn $MAVEN_CLI_OPTS test
deploy:
stage: deploy
script:
- |
if [[ $VERSION = *"SNAPSHOT" || $VERSION = *"RELEASE" ]]; then
mvn $MAVEN_CLI_OPTS deploy
echo "Building Debian package for $VERSION"
mvn $MAVEN_CLI_OPTS -U -Pdariah.deb -Dmaven.test.failure.ignore package
mv colreg-ui/target/*.deb target/
echo "Building documentation"
cd docs
echo "-- Setting up Virtualenv"
virtualenv venv
pwd
. venv/bin/activate
echo "-- Installing requirements"
pip install -r requirements.txt
echo "-- Building HTML version within $(pwd)"
make clean html
echo "-- Creating package"
fpm -t deb -a noarch -s dir --name colreg-doc \
--description='DARIAH-DE ColReg Documentation' \
--maintainer='DARIAH-DE <[email protected]>' \
--vendor='DARIAH-DE' \
--url='https://colreg.de.dariah.eu' \
--version $VERSION \
-x ".git**" \
-x "**/.git**" \
-x "**/.hg**" \
-x "**/.svn**" \
-x ".buildinfo" \
-x "**/*.deb" \
--prefix /var/www/doc/colreg \
-C _build/html .
mv *.deb ../target
~/push_deb_packages.sh ../target
fi