/
.gitlab-ci.yml
155 lines (144 loc) · 4.81 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
default:
image: buildpack-deps:xenial
before_script:
# setup private key to access nniemann/debian-pkgs
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
- echo "$DEPLOY_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan git.ni.dfki.de >> ~/.ssh/known_hosts
- git config --global user.email "gitlab-ci@git.ni.dfki.de"
- git config --global user.name "gitlab-CI/CD"
# clone nniemann/debian-pkgs. These are debian files for pegmatite, rete, sempr
- git clone git@git.ni.dfki.de:nniemann/debian-pkgs.git /tmp/debian-pkgs
# setup and install of rete will be done in the build phase, as it is
# distro-specific (bionic / xenial)
# install dependencies
- apt update -qq
- apt install -y -qq git g++ cmake
- apt install -y -qq libcereal-dev
- apt install -y -qq libgeos-dev libgeos++-dev
- apt install -y -qq libgeographic-dev libeigen3-dev
- apt install -y -qq libboost-all-dev
stages:
- build
- test
- deploy
build-xenial:
stage: build
image: buildpack-deps:xenial
script:
# get and install rete
- echo "deb [trusted=yes] file:/tmp/debian-pkgs/xenial ./" >> /etc/apt/sources.list
- apt update -qq
- apt install -y -qq rete
# install soprano (qt4)
- apt install -y -qq libsoprano-dev qt4-default
# build sempr
- mkdir build_xenial && cd build_xenial
- cmake ..
- make -j8
- export LD_LIBRARY_PATH=$(pwd)/src:$LD_LIBRARY_PATH # fixes a problem with dpkg-shlibdeps not finding libraries built by this project
- make package
artifacts:
paths:
- build_xenial
expire_in: 1 hour
build-bionic:
stage: build
image: buildpack-deps:bionic
script:
# get and install rete
- echo "deb [trusted=yes] file:/tmp/debian-pkgs/bionic ./" >> /etc/apt/sources.list
- apt update -qq
- apt install -y -qq rete
# install libsoprano4-qt5-dev (soprano qt5)
- apt install -y -qq libsoprano4-qt5-dev qt5-default
# build sempr
- mkdir build_bionic && cd build_bionic
- cmake ..
- make -j8
- export LD_LIBRARY_PATH=$(pwd)/src:$LD_LIBRARY_PATH # fixes a problem with dpkg-shlibdeps not finding libraries built by this project
- make package
artifacts:
paths:
- build_bionic
expire_in: 1 hour
build-focal:
stage: build
image: buildpack-deps:focal
script:
# get and install rete
- echo "deb [trusted=yes] file:/tmp/debian-pkgs/focal ./" >> /etc/apt/sources.list
- apt update -qq
- apt install -y -qq rete
# install libsoprano4-qt5-dev (soprano qt5)
- apt install -y -qq libsoprano4-qt5-dev qt5-default
# build sempr
- mkdir build_focal && cd build_focal
- cmake ..
- make -j8
- make package
artifacts:
paths:
- build_focal
expire_in: 1 hour
test-xenial:
stage: test
image: buildpack-deps:xenial
dependencies:
- build-xenial
script:
# get and install rete
- echo "deb [trusted=yes] file:/tmp/debian-pkgs/xenial ./" >> /etc/apt/sources.list
- apt update -qq
- apt install -y -qq rete
# install soprano (qt4)
- apt install -y -qq libsoprano-dev qt4-default
# test
- cd build_xenial
- make test
test-bionic:
stage: test
image: buildpack-deps:bionic
dependencies:
- build-bionic
script:
# get and install rete
- echo "deb [trusted=yes] file:/tmp/debian-pkgs/bionic ./" >> /etc/apt/sources.list
- apt update -qq
- apt install -y -qq rete
# install libsoprano4-qt5-dev (soprano qt5)
- apt install -y -qq libsoprano4-qt5-dev qt5-default
# test
- cd build_bionic
- make test
test-focal:
stage: test
image: buildpack-deps:focal
dependencies:
- build-focal
script:
# get and install rete
- echo "deb [trusted=yes] file:/tmp/debian-pkgs/focal ./" >> /etc/apt/sources.list
- apt update -qq
- apt install -y -qq rete
# install libsoprano4-qt5-dev (soprano qt5)
- apt install -y -qq libsoprano4-qt5-dev qt5-default
# test
- cd build_focal
- make test
deploy-deb:
stage: deploy
only:
- tags
script:
- cp build_xenial/sempr*.deb /tmp/debian-pkgs/xenial/
- cp build_bionic/sempr*.deb /tmp/debian-pkgs/bionic/
- cp build_focal/sempr*.deb /tmp/debian-pkgs/focal/
- cd /tmp/debian-pkgs
- ./update-pkg-list
- git add --all
- git commit -m "auto deployment of sempr $CI_COMMIT_REF_NAME"
- git push