-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update Makefile for macosX installation about using luajit building deps #217
Changes from 5 commits
c0bf845
2fb0a48
90112de
a79f646
ad57125
0d3aa6c
4e78b61
29d07e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,3 +47,8 @@ go | |
\.* | ||
conf/apisix.uid | ||
deps | ||
scgi_temp | ||
uwsgi_temp | ||
proxy_temp | ||
fastcgi_temp | ||
client_body_temp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/usr/bin/env bash | ||
|
||
### BEGIN ### | ||
# Author: idevz | ||
# Since: 08:52:47 2019/07/08 | ||
# Description: travis_runner.sh | ||
# travis_runner ./travis_runner.sh | ||
# | ||
# Environment variables that control this script: | ||
# | ||
### END ### | ||
|
||
set -ex | ||
|
||
export_or_prefix() { | ||
if [ $TRAVIS_OS_NAME = osx ]; then | ||
export OPENRESTY_PREFIX=$(TMP='./v_tmp' && $(which openresty) -V &>${TMP} && | ||
cat ${TMP} | grep prefix | grep -Eo 'prefix=(.*?)/nginx' | | ||
grep -Eo '/.*/' && rm ${TMP}) | ||
else | ||
export OPENRESTY_PREFIX="/usr/local/openresty-debug" | ||
fi | ||
} | ||
|
||
before_install() { | ||
sudo cpanm --notest Test::Nginx IPC::Run >build.log 2>&1 || (cat build.log && exit 1) | ||
} | ||
|
||
do_install() { | ||
if [ $TRAVIS_OS_NAME = osx ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's more convenient for different systems to use separate scripts. how about: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if using like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how about this way in travis: |
||
brew install openresty/brew/openresty-debug | ||
else | ||
wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add - | ||
sudo apt-get -y install software-properties-common | ||
sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" | ||
sudo apt-get update | ||
sudo apt-get install openresty-debug | ||
fi | ||
|
||
export_or_prefix | ||
|
||
luarocks install --lua-dir=${OPENRESTY_PREFIX}luajit luacov-coveralls --local --tree=deps | ||
|
||
if [ $TRAVIS_OS_NAME = osx ]; then | ||
make dev | ||
else | ||
sudo luarocks install --lua-dir=${OPENRESTY_PREFIX}luajit apisix-*.rockspec --only-deps | ||
fi | ||
|
||
git clone https://github.com/openresty/test-nginx.git test-nginx | ||
} | ||
|
||
script() { | ||
export_or_prefix | ||
export PATH=$OPENRESTY_PREFIX/nginx/sbin:$OPENRESTY_PREFIX/luajit/bin:$OPENRESTY_PREFIX/bin:$PATH | ||
if [ $TRAVIS_OS_NAME = osx ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer this style:
|
||
luarocks install luacheck | ||
brew services start etcd | ||
make help | ||
make init | ||
sudo make run | ||
mkdir -p logs | ||
sleep 1 | ||
sudo make stop | ||
|
||
sudo cpanm Test::Nginx | ||
|
||
sleep 1 | ||
make check || exit 1 | ||
|
||
ln -sf $PWD/deps/lib $PWD/deps/lib64 | ||
APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -I./ -r t | ||
else | ||
sudo service etcd start | ||
./bin/apisix help | ||
./bin/apisix init | ||
./bin/apisix init_etcd | ||
./bin/apisix start | ||
mkdir -p logs | ||
sleep 1 | ||
./bin/apisix stop | ||
sleep 1 | ||
make check || exit 1 | ||
APISIX_ENABLE_LUACOV=1 prove -Itest-nginx/lib -r t | ||
fi | ||
} | ||
|
||
after_success() { | ||
luacov-coveralls | ||
} | ||
|
||
case_opt=$1 | ||
shift | ||
|
||
case ${case_opt} in | ||
before_install) | ||
before_install "$@" | ||
;; | ||
do_install) | ||
do_install "$@" | ||
;; | ||
script) | ||
script "$@" | ||
;; | ||
after_success) | ||
after_success "$@" | ||
;; | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'./v_tmp' -> '/tmp/v_tmp', how about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't make any sense, the
v_tmp
file will been clean immediately at the end of this command.