Skip to content
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 install.sh #74

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions conf/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,26 @@ set -euo pipefail
echo Installing ozy pointing at the ozy sample team configuration on GitHub...

OZY_CONFIG_URL=https://raw.githubusercontent.com/aquanauts/ozy/main/conf/sample-team-conf.yaml
OZY_OS=linux
if [[ "$(uname)" == "Darwin" ]]; then OZY_OS=osx; fi
OZY_VERSION=$(curl -sL ${OZY_CONFIG_URL} | grep 'ozy_version:' | awk '{print $2}')
OZY_OS=$(uname)
OZY_ARCH=$(uname -p)

TMP_INSTALL_FILE="$(mktemp)"
curl -sL -o "${TMP_INSTALL_FILE}" https://github.com/aquanauts/ozy/releases/download/v${OZY_VERSION}/ozy-${OZY_OS}
if [ -n "${OZY_VERSION:-}" ]; then
echo "Using ${OZY_VERSION} as it was set in the environment"
else
echo "Reading config information from ${OZY_CONFIG_URL}"
OZY_VERSION=$(curl --fail -sSL ${OZY_CONFIG_URL} | grep 'ozy_version:' | awk '{print $2}')
echo "Found ozy version ${OZY_VERSION}"
fi

echo Installing ozy v${OZY_VERSION} for ${OZY_OS}-${OZY_ARCH}

TMP_INSTALL_DIR=${HOME}/.tmp-ozy-install-$$ # on same path as HOME because of issue #73
mkdir -p "${TMP_INSTALL_DIR}"
TMP_INSTALL_FILE=${TMP_INSTALL_DIR}/ozy # ozy needs to be called "ozy" to work
curl -sL -o "${TMP_INSTALL_FILE}" https://github.com/aquanauts/ozy/releases/download/v${OZY_VERSION}/ozy-${OZY_OS}-${OZY_ARCH}
chmod +x "${TMP_INSTALL_FILE}"
${TMP_INSTALL_FILE} init ${OZY_CONFIG_URL}
rm -f "${TMP_INSTALL_FILE}"
rm -rf "${TMP_INSTALL_DIR}"

echo
echo '********************************'
Expand Down