-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
182 lines (182 loc) · 3.72 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
image: patgrosse/riotsensors-build
stages:
- prepare
- cmake
- buildProtocol
- build
- test
- buildServer
- docs
- deploy
#cache:
# key: "$CI_BUILD_REF_NAME"
# paths:
# - lib/gcc-arm-none-eabi-6_2-2016q4-20161216-linux.tar.bz2
# =================
# prepare stage
# =================
getlibs:
variables:
GIT_STRATEGY: clone
stage: prepare
script:
- "./prebuild.sh"
artifacts:
paths:
- lib/
# =================
# cmake stage
# =================
cmake:
stage: cmake
dependencies:
- getlibs
script:
- "mkdir -p build"
- "cd build"
- "cmake .."
artifacts:
paths:
- build/
# =================
# build stage
# =================
build:protocol:
stage: buildProtocol
dependencies:
- cmake
- getlibs
script:
- "cd build/protocol"
- "make"
artifacts:
paths:
- build/
build:RIOTmodule:
stage: build
dependencies:
- getlibs
- build:protocol
script:
- "cd build/riotmodule"
- "make"
artifacts:
paths:
- build/
build:linuxconnector:
stage: build
dependencies:
- getlibs
- build:protocol
script:
- "cd build/linuxconnector"
- "make"
artifacts:
paths:
- build/
# =================
# buildServer stage
# =================
build:restserver:
stage: buildServer
dependencies:
- getlibs
- build:linuxconnector
script:
- "cd build/restserver"
- "make"
artifacts:
paths:
- build/
# =================
# test stage
# =================
test:protocol:
stage: test
dependencies:
- build:protocol
script:
- "cd build/protocol/tests"
- "./protocol_tests"
test:RIOTmodule:
stage: test
dependencies:
- build:RIOTmodule
script:
- "cd build/riotmodule/tests"
- "./riot_tests"
test:linuxconnector:
stage: test
dependencies:
- build:linuxconnector
script:
- "cd build/linuxconnector/tests"
- "./linux_tests"
# =================
# docs stage
# =================
doxygenDocs:
stage: docs
dependencies: []
before_script: []
image: iimuz/doxygen
when: always
script:
- "mkdir -p build/doxygen"
- "doxygen Doxyfile"
- "mkdir -p build/doxygen/html/docs"
- "cp -r docs/img build/doxygen/html/docs"
artifacts:
paths:
- "build/doxygen"
swaggerDocs:
stage: docs
dependencies: []
before_script: []
image: openjdk:alpine
when: always
script:
- "mkdir -p build/swagger-linux"
- "mkdir -p build/swagger-riot"
- "apk update"
- "apk add ca-certificates"
- "update-ca-certificates"
- "apk --no-cache add openssl"
- "wget https://oss.sonatype.org/content/repositories/releases/io/swagger/swagger-codegen-cli/2.2.1/swagger-codegen-cli-2.2.1.jar"
- "java -jar swagger-codegen-cli-2.2.1.jar generate -i restserver/swagger-linux.yml -l html2 -o build/swagger-linux"
- "java -jar swagger-codegen-cli-2.2.1.jar generate -i restserver/swagger-riot.yml -l html2 -o build/swagger-riot"
artifacts:
paths:
- "build/swagger-linux"
- "build/swagger-riot"
# =================
# deploy stage
# =================
trigger_example:
stage: deploy
dependencies: []
before_script: []
script:
- "curl -X POST -F token=$TRIGGER_EXAMPLE_TOKEN -F ref=$TRIGGER_EXAMPLE_REF $TRIGGER_EXAMPLE_URL"
pages:
stage: deploy
dependencies:
- doxygenDocs
- swaggerDocs
before_script: []
when: always
script:
- "rm -rf public"
- "mkdir -p public"
- "cp -r docs/* public"
- "mkdir -p public/doxygen"
- "cp -r build/doxygen/html/* public/doxygen"
- "mkdir -p public/swagger-linux"
- "cp -r build/swagger-linux/* public/swagger-linux"
- "mkdir -p public/swagger-riot"
- "cp -r build/swagger-riot/* public/swagger-riot"
artifacts:
paths:
- public
only:
- master