1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00
portainer/build/download_docker_compose_binary.sh
Steven Kang 08fdebfbd9
feat(ci): introduce GH Actions for Portainer CE (#10419)
Co-authored-by: Chaim Lev-Ari <chaim.levi-ari@portainer.io>
2023-10-24 13:30:33 +03:00

30 lines
801 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
if [[ $# -ne 3 ]]; then
echo "Illegal number of parameters" >&2
exit 1
fi
PLATFORM=$1
ARCH=$2
COMPOSE_VERSION=$3
if [[ ${ARCH} == "amd64" ]]; then
ARCH="x86_64"
elif [[ ${ARCH} == "arm" ]]; then
ARCH="armv7"
elif [[ ${ARCH} == "arm64" ]]; then
ARCH="aarch64"
fi
if [[ "$PLATFORM" == "windows" ]]; then
wget --tries=3 --waitretry=30 --quiet -O "dist/docker-compose.exe" "https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-windows-${ARCH}.exe"
chmod +x "dist/docker-compose.exe"
else
wget --tries=3 --waitretry=30 --quiet -O "dist/docker-compose" "https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-${PLATFORM}-${ARCH}"
chmod +x "dist/docker-compose"
fi