-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·52 lines (52 loc) · 1.8 KB
/
build.sh
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
#!/bin/sh
OTP_VERSION=20
CI_PROJECT_DIR=$(pwd)
ERL_LIBS=/usr/local/Cellar/erlang/20.3.2/lib
OPENSSL_LIB=/usr/local/Cellar//openssl/1.0.2j/lib
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
mkdir -p .build/otp-$OTP_VERSION/ocs
cd .build/otp-$OTP_VERSION/
echo "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
echo "Install radierl"
git clone https://github.com/sigscale/radierl.git
cd radierl
aclocal
autoheader
autoconf
automake --add-missing
#LD_FLAGS=$OPENSSL_LIB ./configure --with-ssl=$OPENSSL_LIB --prefix=$(pwd)/ocsinstall
./configure
make && make install
echo "Install OCS"
cd $CI_PROJECT_DIR/.build/otp-$OTP_VERSION/ocs
../../../configure
make
echo "Installing OCS GUI"
cd ../../../priv/www
npm install -g bower
bower --allow-root install
mv bower_components/* ./
mv ./* $CI_PROJECT_DIR/.build/otp-$OTP_VERSION/ocs/priv/www/
mkdir -p $CI_PROJECT_DIR/.build/otp-$OTP_VERSION/ocs/log/http
cd $CI_PROJECT_DIR/.build/otp-$OTP_VERSION/ocs
cp $CI_PROJECT_DIR/sys.config ./
# go back to ocs main dir
#if [ ! -d $CI_PROJECT_DIR/.build/otp-$OTP_VERSION/ocs/db ]; then
# echo "Initialising DB"
# erl -pa ebin ../lib/mochiweb-2.17.0/ebin ../lib/radius-1.4.4/ebin -sname ocs -config sys -s ocs_app install #-s init stop
#fi
#erl -pa ebin ../lib/mochiweb-2.17.0/ebin ../lib/radius-1.4.4/ebin -sname ocs -config sys -eval 'systools:make_script("ocs",[local])' # -s init stop