From a02e2d2aa21d0ce6bb2e90d05bf4dd7e9f748713 Mon Sep 17 00:00:00 2001 From: Richard Gee Date: Fri, 21 Dec 2018 21:13:24 +0000 Subject: [PATCH] Consolidate deploy_stack.sh files Currently there are multiple deploy_stack.sh files and the user has to select the version appropriate to the target architecture so that the correct images are deployed. Further, the armhf deploy script lacks the basic auth by default scripting that is in the x86_64 version. This change adds a case/select to deploy_stack.sh that will determine the hardware architecture and select the appropriate docker-compose file. The deploy_stack.armhf.sh is also changed, rather than deleted, so that existing references are still valid. Signed-off-by: Richard Gee --- deploy_stack.armhf.sh | 8 +------- deploy_stack.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/deploy_stack.armhf.sh b/deploy_stack.armhf.sh index b8b0aef5..fce19cb7 100755 --- a/deploy_stack.armhf.sh +++ b/deploy_stack.armhf.sh @@ -1,9 +1,3 @@ #!/bin/sh -if ! [ -x "$(command -v docker)" ]; then - echo 'Unable to find docker command, please install Docker (https://www.docker.com/) and retry' >&2 - exit 1 -fi - -echo "Deploying stack" -docker stack deploy func --compose-file docker-compose.armhf.yml +sh ./deploy_stack.sh diff --git a/deploy_stack.sh b/deploy_stack.sh index c38ce917..a9ffd66c 100755 --- a/deploy_stack.sh +++ b/deploy_stack.sh @@ -49,6 +49,18 @@ else echo "" fi -echo "Deploying OpenFaaS core services" +arch=$(uname -m) +case "$arch" in -docker stack deploy func --compose-file docker-compose.yml +"armv7l") echo "Deploying OpenFaaS core services for ARM" + composefile="docker-compose.armhf.yml" + ;; +"aarch64") echo "Deploying OpenFaaS core services for ARM64" + composefile="docker-compose.arm64.yml" + ;; +*) echo "Deploying OpenFaaS core services" + composefile="docker-compose.yml" + ;; +esac + +docker stack deploy func --compose-file $composefile