Skip to content

Commit

Permalink
remove annotations and add sudo permission
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinsRan committed Dec 29, 2023
1 parent 35a4d3b commit cc2e1a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ENV_HOMEBREW_PREFIX ?= /usr/local
ENV_RUNTIME_VER ?= $(shell $(ENV_NGINX_EXEC) -V 2>&1 | tr ' ' '\n' | grep 'APISIX_RUNTIME_VER' | cut -d '=' -f2)

-include .requirements
export

ifneq ($(shell whoami), root)
ENV_LUAROCKS_FLAG_LOCAL := --local
Expand Down
24 changes: 14 additions & 10 deletions utils/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

set -ex

source .requirements

function detect_aur_helper() {
if [[ $(command -v yay) ]]; then
AUR_HELPER=yay
Expand Down Expand Up @@ -81,7 +79,6 @@ function install_dependencies_with_apt() {

# install some compilation tools
sudo apt-get install -y curl make gcc g++ cpanminus libpcre3 libpcre3-dev libldap2-dev unzip openresty-zlib-dev openresty-pcre-dev
# get the APISIX_RUNTIME from .requirements
}

# Install dependencies on mac osx
Expand Down Expand Up @@ -113,23 +110,23 @@ function multi_distro_installation() {

function multi_distro_uninstallation() {
if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
yum autoremove -y openresty-zlib-devel openresty-pcre-devel
sudo yum autoremove -y openresty-zlib-devel openresty-pcre-devel
elif grep -Eqi -e "Red Hat" -e "rhel" /etc/*-release; then
yum autoremove -y openresty-zlib-devel openresty-pcre-devel
sudo yum autoremove -y openresty-zlib-devel openresty-pcre-devel
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
yum autoremove -y openresty-zlib-devel openresty-pcre-devel
sudo yum autoremove -y openresty-zlib-devel openresty-pcre-devel
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
pt-get autoremove -y openresty-zlib-dev openresty-pcre-dev
sudo apt-get autoremove -y openresty-zlib-dev openresty-pcre-dev
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
apt-get autoremove -y openresty-zlib-dev openresty-pcre-dev
sudo apt-get autoremove -y openresty-zlib-dev openresty-pcre-dev
else
echo "Non-supported operating system version"
exit 1
fi
}

function install_apisix_runtime() {
export runtime_version=${APISIX_RUNTIME}
export runtime_version=${APISIX_RUNTIME:?}
wget "https://raw.githubusercontent.com/api7/apisix-build-tools/apisix-runtime/${APISIX_RUNTIME}/build-apisix-runtime.sh"
chmod +x build-apisix-runtime.sh
./build-apisix-runtime.sh latest
Expand All @@ -138,7 +135,14 @@ function install_apisix_runtime() {

# Install LuaRocks
function install_luarocks() {
./utils/linux-install-luarocks.sh
if [ -f "./utils/linux-install-luarocks.sh" ]; then
./utils/linux-install-luarocks.sh
elif [ -f "./linux-install-luarocks.sh" ]; then
./linux-install-luarocks.sh
else
echo "Installing luarocks from remote master branch"
curl https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh -sL | bash -
fi
}

# Entry
Expand Down

0 comments on commit cc2e1a8

Please sign in to comment.