leslie-tsang commented on a change in pull request #5209:
URL: https://github.com/apache/apisix/pull/5209#discussion_r726865662
##########
File path: utils/install-dependencies.sh
##########
@@ -104,24 +102,25 @@ function multi_distro_installation() {
# Install etcd
function install_etcd() {
- wget
https://github.com/etcd-io/etcd/releases/download/v3.4.13/etcd-v3.4.13-linux-amd64.tar.gz
- tar -xvf etcd-v3.4.13-linux-amd64.tar.gz && \
- cd etcd-v3.4.13-linux-amd64 && \
+ ETCD_VERSION='3.4.13'
+ wget
https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz
+ tar -xvf etcd-v${ETCD_VERSION}-linux-amd64.tar.gz && \
+ cd etcd-v${ETCD_VERSION}-linux-amd64 && \
sudo cp -a etcd etcdctl /usr/bin/
nohup etcd &
}
# Entry
-function main() {
- a=`uname -s`
- if [[ ${a} == "Linux" ]]; then
+function main() {
+ OS_NAME=$(uname -s | tr '[:upper:]' '[:lower:]')
+ if [[ ${OS_NAME} == "linux" ]]; then
multi_distro_installation
install_etcd
- elif [[ ${a} == "Darwin" ]]; then
+ elif [[ ${OS_NAME} == "darwin" ]]; then
install_dependencies_on_mac_osx
else
echo "Non-surported distribution"
fi
}
-main
+main
Review comment:
New line in need.
##########
File path: utils/install-dependencies.sh
##########
@@ -0,0 +1,127 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Install dependencies on centos
+function install_dependencies_on_centos() {
+ # add OpenResty source
+ sudo yum install yum-utils
+ sudo yum-config-manager --add-repo
https://openresty.org/package/centos/openresty.repo
+
+ # install OpenResty and some compilation tools
+ sudo yum install -y openresty curl git gcc openresty-openssl111-devel
unzip pcre pcre-devel
+
+ # install LuaRocks
+ curl
https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh
-sL | bash -
Review comment:
Make sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]