Skip to content

Commit

Permalink
chore(script): support to install dependencies under arm64 (apache#7091)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulbird authored and Liu-Junlin committed Nov 4, 2022
1 parent e57dcde commit 87b498c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
18 changes: 13 additions & 5 deletions utils/linux-install-etcd-client.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand All @@ -17,7 +17,15 @@
# limitations under the License.
#

wget https://github.com/etcd-io/etcd/releases/download/v3.4.18/etcd-v3.4.18-linux-amd64.tar.gz
tar xf etcd-v3.4.18-linux-amd64.tar.gz
sudo cp etcd-v3.4.18-linux-amd64/etcdctl /usr/local/bin/
rm -rf etcd-v3.4.18-linux-amd64
ETCD_ARCH="amd64"
ETCD_VERSION=${ETCD_VERSION:-'3.4.18'}
ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`}

if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then
ETCD_ARCH="arm64"
fi

wget https://github.com/etcd-io/etcd/releases/download/v${ETCD_VERSION}/etcd-v3.4.18-linux-${ETCD_ARCH}.tar.gz
tar xf etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}.tar.gz
sudo cp etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}/etcdctl /usr/local/bin/
rm -rf etcd-v${ETCD_VERSION}-linux-${ETCD_ARCH}
8 changes: 7 additions & 1 deletion utils/linux-install-openresty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@
#
set -euo pipefail

ARCH=${ARCH:-`(uname -m | tr '[:upper:]' '[:lower:]')`}
arch_path=""
if [[ $ARCH == "arm64" ]] || [[ $ARCH == "aarch64" ]]; then
arch_path="arm64/"
fi

wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
sudo apt-get -y update --fix-missing
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y "deb https://openresty.org/package/ubuntu $(lsb_release -sc) main"
sudo add-apt-repository -y "deb https://openresty.org/package/${arch_path}ubuntu $(lsb_release -sc) main"

sudo apt-get update

Expand Down

0 comments on commit 87b498c

Please sign in to comment.