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

Example install script is broken #72

Open
mattgodbolt opened this issue Nov 25, 2023 · 1 comment
Open

Example install script is broken #72

mattgodbolt opened this issue Nov 25, 2023 · 1 comment

Comments

@mattgodbolt
Copy link
Contributor

I tried fixing but got as far as:

#!/usr/bin/env bash
# Should be suitable to be `curl | bash`'d

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=$(uname)
OZY_ARCH=$(uname -p)
#OZY_VERSION=$(curl -sL ${OZY_CONFIG_URL} | grep 'ozy_version:' | awk '{print $2}')
OZY_VERSION=0.1.8

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

TMP_INSTALL_FILE="$(mktemp)"
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}"

echo
echo '********************************'
echo 'Installed ok. Make sure you follow any instructions above to ensure ozy is on your path.'
echo '********************************'

added the OS and ARCH properly, hacking it to 0.1.8 but still:

Installing ozy pointing at the ozy sample team configuration on GitHub...
Installing ozy v0.1.8 for Linux-x86_64
Error: While loading ozy config

Caused by:
    0: Reading config YAML
    1: No such file or directory (os error 2)

In fact, any attemp to execute the ozy cases this:

bollo:~/d/c/ce-ci (main|✚1) $ /tmp/tmp.CYWrZW95Nt --help
Error: While loading ozy config

Caused by:
    0: Reading config YAML
    1: No such file or directory (os error 2)
@mattgodbolt
Copy link
Contributor Author

Slightly better:

#!/usr/bin/env bash
# Should be suitable to be `curl | bash`'d

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=$(uname)
OZY_ARCH=$(uname -p)

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=/tmp/install-ozy-$$
mkdir ${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 -rf "${TMP_INSTALL_DIR}"

echo
echo '********************************'
echo 'Installed ok. Make sure you follow any instructions above to ensure ozy is on your path.'
echo '********************************'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant