Compare commits

...

5 Commits

Author SHA1 Message Date
Orz
990eda74eb fix: convent error 2025-10-28 18:42:06 +08:00
7230081401 fix(install): bad release substitution 2025-10-20 00:02:53 +00:00
f0fc694d50 Fix typo
not important but...
2025-10-18 13:22:36 +00:00
d92cc8a01c Fixup comments remove hard coded tagname 2025-10-18 13:22:36 +00:00
3abfaf591c feat(install)
Installation should now be taken from katenary.io
2025-10-18 13:22:36 +00:00
2 changed files with 16 additions and 9 deletions

View File

@@ -4,20 +4,25 @@
# Can be launched with the following command: # Can be launched with the following command:
# sh <(curl -sSL https://raw.githubusercontent.com/Katenary/katenary/master/install.sh) # sh <(curl -sSL https://raw.githubusercontent.com/Katenary/katenary/master/install.sh)
set -e
# Detect the OS and architecture # Detect the OS and architecture
OS=$(uname) OS=$(uname)
ARCH=$(uname -m) ARCH=$(uname -m)
for c in curl grep cut tr; do
if ! command -v $c >/dev/null 2>&1; then
echo "Error: $c is not installed"
exit 1
fi
done
# Detect the home directory "bin" directory, it is commonly: # Detect the home directory "bin" directory, it is commonly:
# - $HOME/.local/bin # - $HOME/.local/bin
# - $HOME/.bin # - $HOME/.bin
# - $HOME/bin # - $HOME/bin
COMON_INSTALL_PATHS="$HOME/.local/bin $HOME/.bin $HOME/bin" COMMON_INSTALL_PATHS="$HOME/.local/bin $HOME/.bin $HOME/bin"
INSTALL_PATH="" INSTALL_PATH=""
for p in $COMON_INSTALL_PATHS; do for p in $COMMON_INSTALL_PATHS; do
if [ -d $p ]; then if [ -d $p ]; then
INSTALL_PATH=$p INSTALL_PATH=$p
break break
@@ -43,20 +48,22 @@ if ! echo "$PATH" | grep -q "$INSTALL_PATH"; then
fi fi
# Where to download the binary # Where to download the binary
BASE="https://github.com/Katenary/katenary/releases/latest/download/" TAG=$(curl -sLf https://repo.katenary.io/api/v1/repos/katenary/katenary/releases/latest 2>/dev/null | grep -Po '"tag_name":\s*"[^"]*"' | cut -d ":" -f2 | tr -d '"')
TAG=${TAG#releases/}
# for compatibility with older ARM versions # use the right names for the OS and architecture
if [ $ARCH = "x86_64" ]; then if [ $ARCH = "x86_64" ]; then
ARCH="amd64" ARCH="amd64"
fi fi
BIN_URL="$BASE/katenary-$OS-$ARCH" BIN_URL="https://repo.katenary.io/api/packages/Katenary/generic/katenary/$TAG/katenary-$OS-$ARCH"
echo echo
echo "Downloading $BIN_URL" echo "Downloading $BIN_URL"
T=$(mktemp -u) T=$(mktemp -u)
curl -SL -# $BIN_URL -o $T || (echo "Failed to download katenary" && rm -f $T && exit 1) curl -sLf -# $BIN_URL -o $T 2>/dev/null || (echo -e "Failed to download katenary version $TAG.\n\nPlease open an issue and explain the problem, following the link:\nhttps://repo.katenary.io/Katenary/katenary/issues/new?title=[install.sh]%20Install%20$TAG%20failed" && rm -f $T && exit 1)
mv "$T" "${INSTALL_PATH}/katenary" mv "$T" "${INSTALL_PATH}/katenary"
chmod +x "${INSTALL_PATH}/katenary" chmod +x "${INSTALL_PATH}/katenary"

View File

@@ -41,7 +41,7 @@ func Parse(profiles []string, envFiles []string, dockerComposeFile ...string) (*
} }
} }
options, err := cli.NewProjectOptions(nil, options, err := cli.NewProjectOptions(dockerComposeFile,
cli.WithProfiles(profiles), cli.WithProfiles(profiles),
cli.WithInterpolation(true), cli.WithInterpolation(true),
cli.WithDefaultConfigPath, cli.WithDefaultConfigPath,