-
Notifications
You must be signed in to change notification settings - Fork 45
/
.gitlab-ci.yml
174 lines (161 loc) · 4.03 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
# Configuration for GitLab CI/CD
# # https://gitlab.com/sigscale/ocs
stages:
- build
- test
- deploy
.build:otp: &build_otp
stage: build
image: erlang
before_script:
- curl -sS http://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- curl -sL http://deb.nodesource.com/setup_lts.x | bash -
- apt-get -y update
- apt-get -y install nodejs yarn
- export PATH="$PATH:`yarn global bin`"
script:
# Prepare environmental variables
- export ERL_LIBS="${CI_PROJECT_DIR}/.build/otp-${OTP_VERSION}/lib"
- export ERLANG_INSTALL_LIB_DIR=${ERL_LIBS}
- aclocal
- autoheader
- autoconf
- libtoolize --automake
- automake --add-missing
- rm -rf .build/otp-${OTP_VERSION}
- mkdir -p .build/otp-${OTP_VERSION}/{lib,ocs}
- cd .build/otp-${OTP_VERSION}/
# Install mochiweb
- git clone https://github.com/mochi/mochiweb.git
- cd mochiweb
- make all
- MOCHIWEB_VERSION=`grep vsn ebin/mochiweb.app | cut -d"\"" -f 2`
- cd ../../
- if [ ! -d otp-${OTP_VERSION}/lib/mochiweb-${MOCHIWEB_VERSION} ]; then mv -v otp-${OTP_VERSION}/mochiweb/ otp-${OTP_VERSION}/lib/mochiweb-${MOCHIWEB_VERSION}; fi
# Install radierl
- git clone https://gitlab.com/sigscale/radierl.git
- cd radierl
- aclocal
- autoheader
- autoconf
- automake --add-missing
- ./configure
- make
- make install
# Install sigscale_mibs
- git clone https://gitlab.com/sigscale/sigscale_mibs.git
- cd sigscale_mibs
- aclocal
- autoheader
- autoconf
- automake --add-missing
- ./configure
- make
- make install
# ocs
- cd ${CI_PROJECT_DIR}/.build/otp-${OTP_VERSION}/ocs
- ../../../configure
- make
build:otp-21:
<<: *build_otp
image: erlang:21
artifacts:
untracked: true
paths:
- .build/otp-21.*
build:otp-20:
<<: *build_otp
image: erlang:20
artifacts:
untracked: true
paths:
- .build/otp-20.*
build:otp-18:
<<: *build_otp
image: erlang:18
artifacts:
untracked: true
paths:
- .build/otp-18.*
.check:otp: &check_otp
stage: test
image: erlang
script:
- export ERL_LIBS="${CI_PROJECT_DIR}/.build/otp-${OTP_VERSION}/lib"
- export DIALYZER_PLT="${CI_PROJECT_DIR}/.build/otp-${OTP_VERSION}/.dialyzer_plt"
- if ! dialyzer --plt_info; then dialyzer --no_native --build_plt --apps erts kernel stdlib crypto compiler public_key diameter inets mnesia ssl mochiweb radius syntax_tools; fi
- cd .build/otp-${OTP_VERSION}/ocs
- make check
check:otp-21:
<<: *check_otp
image: erlang:21
artifacts:
when: always
paths:
- .build/otp-21.*
dependencies:
- build:otp-21
check:otp-20:
<<: *check_otp
image: erlang:20
artifacts:
when: always
paths:
- .build/otp-20.*
dependencies:
- build:otp-20
check:otp-18:
<<: *check_otp
image: erlang:18
artifacts:
when: always
paths:
- .build/otp-18.*
dependencies:
- build:otp-18
pages:otp-18:
stage: deploy
script:
- mkdir -p .public/doc .public/tests
- cp -r .build/otp-18.*/ocs/test/log/* .public/tests
- cp -r .build/otp-18.*/ocs/doc/* .public/doc
- mv .public public
artifacts:
when: always
paths:
- public
dependencies:
- check:otp-18
# Temporary option
when: always
pages:otp-20:
stage: deploy
script:
- mkdir -p .public/doc .public/tests
- cp -r .build/otp-20.*/ocs/test/log/* .public/tests
- cp -r .build/otp-20.*/ocs/doc/* .public/doc
- mv .public public
artifacts:
when: always
paths:
- public
dependencies:
- check:otp-20
# Temporary option
when: always
pages:otp-21:
stage: deploy
script:
- mkdir -p .public/doc .public/tests
- cp -r .build/otp-21.*/ocs/test/log/* .public/tests
- cp -r .build/otp-21.*/ocs/doc/* .public/doc
- mv .public public
artifacts:
when: always
paths:
- public
dependencies:
- check:otp-21
# Temporary option
when: always