1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

feat(stacks): support standalone stacks on ARM (#5310)

This commit is contained in:
Chaim Lev-Ari 2021-09-06 10:58:26 +03:00 committed by GitHub
parent 582d370172
commit 3453735c8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 181 additions and 308 deletions

View file

@ -1,18 +1,57 @@
#!/usr/bin/env bash
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
PLATFORM=$1
ARCH=$2
DOCKER_COMPOSE_VERSION=$3
if [ "${PLATFORM}" == 'linux' ] && [ "${ARCH}" == 'amd64' ]; then
wget -O "dist/docker-compose" "https://github.com/portainer/docker-compose-linux-amd64-static-binary/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose"
chmod +x "dist/docker-compose"
elif [ "${PLATFORM}" == 'mac' ]; then
wget -O "dist/docker-compose" "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Darwin-x86_64"
chmod +x "dist/docker-compose"
elif [ "${PLATFORM}" == 'win' ]; then
wget -O "dist/docker-compose.exe" "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Windows-x86_64.exe"
chmod +x "dist/docker-compose.exe"
function download_binary() {
local PLATFORM=$1
local ARCH=$2
local BINARY_VERSION=$3
if [ "${PLATFORM}" == 'linux' ] && [ "${ARCH}" == 'amd64' ]; then
wget -O "dist/docker-compose" "https://github.com/portainer/docker-compose-linux-amd64-static-binary/releases/download/${BINARY_VERSION}/docker-compose"
chmod +x "dist/docker-compose"
return
fi
if [ "${PLATFORM}" == 'mac' ]; then
wget -O "dist/docker-compose" "https://github.com/docker/compose/releases/download/${BINARY_VERSION}/docker-compose-Darwin-x86_64"
chmod +x "dist/docker-compose"
return
fi
if [ "${PLATFORM}" == 'win' ]; then
wget -O "dist/docker-compose.exe" "https://github.com/docker/compose/releases/download/${BINARY_VERSION}/docker-compose-Windows-x86_64.exe"
chmod +x "dist/docker-compose.exe"
return
fi
}
function download_plugin() {
local PLATFORM=$1
local ARCH=$2
local PLUGIN_VERSION=$3
if [ "${PLATFORM}" == 'mac' ]; then
PLATFORM="darwin"
fi
FILENAME="docker-compose-${PLATFORM}-${ARCH}"
TARGET_FILENAME="docker-compose.plugin"
if [[ "$PLATFORM" == "windows" ]]; then
FILENAME="$FILENAME.exe"
TARGET_FILENAME="$TARGET_FILENAME.exe"
fi
wget -O "dist/$TARGET_FILENAME" "https://github.com/docker/compose-cli/releases/download/v$PLUGIN_VERSION/$FILENAME"
chmod +x "dist/$TARGET_FILENAME"
}
if [ "${PLATFORM}" == 'linux' ] && [ "${ARCH}" != 'amd64' ]; then
download_plugin "$PLATFORM" "$ARCH" "$DOCKER_COMPOSE_VERSION"
fi
exit 0
download_binary "$PLATFORM" "$ARCH" "$DOCKER_COMPOSE_VERSION"