diff --git a/Taskfile.yml b/Taskfile.yml index 3c5ca58..2609fa6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,7 +1,7 @@ version: '2' vars: - OPENFAAS_TEMPLATE_STORE_URL: https://raw.githubusercontent.com/MartinHeinz/openfaas-templates/master/templates.json # Default template https://raw.githubusercontent.com/openfaas/store/master/templates.json + OPENFAAS_TEMPLATE_STORE_URL: https://github.com/MartinHeinz/openfaas-templates PREFIX: martinheinz SUFFIX: sh: cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1 @@ -10,7 +10,7 @@ tasks: verify: # task verify (This is ran in CI) dir: ./functions cmds: - - ../verify.sh + - ../verify.sh {{.OPENFAAS_TEMPLATE_STORE_URL}} {{.SUFFIX}} silent: true build: # task build FUNC=my-func @@ -28,7 +28,7 @@ tasks: create: # task create TPL=golang-mod FUNC=my-func dir: ./functions cmds: - - faas-cli template store pull --url={{.OPENFAAS_TEMPLATE_STORE_URL}} {{.TPL}} --overwrite + - faas-cli template pull {{.OPENFAAS_TEMPLATE_STORE_URL}} {{.TPL}} --overwrite - faas-cli new --lang {{.TPL}} {{.FUNC}} --prefix="{{.PREFIX}}" - rm .gitignore - git add {{.FUNC}}.yml ./{{.FUNC}} diff --git a/verify.sh b/verify.sh index ecf7cb9..24f9275 100755 --- a/verify.sh +++ b/verify.sh @@ -2,7 +2,8 @@ set -e CLI="faas-cli" -suffix=$3 +store=$1 +suffix=$2 if ! [ -x "$(command -v faas-cli)" ]; then HERE=`pwd` @@ -13,6 +14,8 @@ if ! [ -x "$(command -v faas-cli)" ]; then cd $HERE fi +$CLI template pull $store + for yaml in ./*.yml do [ -f "$yaml" ] || continue