mirror of
https://github.com/openfaas/faas.git
synced 2025-06-26 08:43:24 +00:00
Refactor CI and enable auto-builds for auth
Automatic builds for auth-module on x86_64 (via Travis) and on-demand on-device for arm via publish.sh The basic-auth module is not built or pushed upon 'tag' / 'release' of the faas repo, but it should be: https://github.com/openfaas/faas/tree/master/auth. We also don't create on-device images for this, but should do for both armhf and arm64: https://github.com/openfaas/faas/blob/master/contrib/publish-arm.sh This change addresses these challenges and also introduces a tagAndPush script to alleviate some of the recently introduced repetition in .travis.yml. Signed-off-by: Richard Gee <richard@technologee.co.uk>
This commit is contained in:
@ -2,4 +2,4 @@ TAG?=latest
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
docker build -t openfaas/basic-auth-plugin:${TAG} .
|
||||
./build.sh ${TAG}
|
||||
|
27
auth/basic-auth/build.sh
Executable file
27
auth/basic-auth/build.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
export arch=$(uname -m)
|
||||
export eTAG="latest-dev"
|
||||
|
||||
if [ "$arch" = "armv7l" ] ; then
|
||||
eTAG="latest-armhf-dev"
|
||||
elif [ "$arch" = "aarch64" ] ; then
|
||||
eTAG="latest-arm64-dev"
|
||||
fi
|
||||
|
||||
echo "$1"
|
||||
if [ "$1" ] ; then
|
||||
eTAG=$1
|
||||
if [ "$arch" = "armv7l" ] ; then
|
||||
eTAG="$1-armhf"
|
||||
elif [ "$arch" = "aarch64" ] ; then
|
||||
eTAG="$1-arm64"
|
||||
fi
|
||||
fi
|
||||
|
||||
NS=openfaas
|
||||
|
||||
echo Building $NS/basic-auth-plugin:$eTAG
|
||||
|
||||
docker build -t $NS/basic-auth-plugin:$eTAG .
|
27
auth/basic-auth/push.sh
Executable file
27
auth/basic-auth/push.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
export arch=$(uname -m)
|
||||
export eTAG="latest-dev"
|
||||
|
||||
if [ "$arch" = "armv7l" ] ; then
|
||||
eTAG="latest-armhf-dev"
|
||||
elif [ "$arch" = "aarch64" ] ; then
|
||||
eTAG="latest-arm64-dev"
|
||||
fi
|
||||
|
||||
echo "$1"
|
||||
if [ "$1" ] ; then
|
||||
eTAG=$1
|
||||
if [ "$arch" = "armv7l" ] ; then
|
||||
eTAG="$1-armhf"
|
||||
elif [ "$arch" = "aarch64" ] ; then
|
||||
eTAG="$1-arm64"
|
||||
fi
|
||||
fi
|
||||
|
||||
NS=openfaas
|
||||
|
||||
echo Pushing $NS/basic-auth-plugin:$eTAG
|
||||
|
||||
docker push $NS/basic-auth-plugin:$eTAG
|
Reference in New Issue
Block a user