Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Sniff the OS and ARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
squaremo committed Apr 30, 2019
1 parent 531ec06 commit d601c6d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
3 changes: 3 additions & 0 deletions test/e2e/e2e-echo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
set -o errexit

source $(dirname $0)/e2e-paths.env
source $(dirname $0)/machine.env

echo REPO_ROOT=$REPO_ROOT
echo BASE=$BASE
echo GOBIN=$GOBIN
echo OS=$OS
echo ARCH=$ARCH
7 changes: 4 additions & 3 deletions test/e2e/e2e-golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
set -o errexit

source $(dirname $0)/e2e-paths.env
source $(dirname $0)/machine.env

GO_VERSION=1.11.4

echo ">>> Installing go ${GO_VERSION} to $GOBASE/go"
if ! [ -f "go${GO_VERSION}.linux-amd64.tar.gz" ]; then
curl -O https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz
if ! [ -f "go${GO_VERSION}.${OS}-${ARCH}.tar.gz" ]; then
curl -O https://storage.googleapis.com/golang/go${GO_VERSION}.${OS}-${ARCH}.tar.gz
fi
tar -xf go1.11.4.linux-amd64.tar.gz
tar -xf go1.11.4.${OS}-${ARCH}.tar.gz
rm -rf $GOBASE/go
mkdir -p $GOBASE
mv go $GOBASE/
Expand Down
19 changes: 19 additions & 0 deletions test/e2e/machine.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# not for execution; sets some variables up

ARCH=$(uname -m)
case $ARCH in
armv5*) ARCH="armv5";;
armv6*) ARCH="armv6";;
armv7*) ARCH="arm";;
aarch64) ARCH="arm64";;
x86) ARCH="386";;
x86_64) ARCH="amd64";;
i686) ARCH="386";;
i386) ARCH="386";;
esac

OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')
case "$OS" in
# Minimalist GNU for Windows
mingw*) OS='windows';;
esac

0 comments on commit d601c6d

Please sign in to comment.