Skip to content

Commit

Permalink
Update Taskfile create and verify targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHeinz committed Nov 18, 2019
1 parent 01b6a50 commit b6301f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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}}
Expand Down
5 changes: 4 additions & 1 deletion verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -e

CLI="faas-cli"
suffix=$3
store=$1
suffix=$2

if ! [ -x "$(command -v faas-cli)" ]; then
HERE=`pwd`
Expand All @@ -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
Expand Down

0 comments on commit b6301f0

Please sign in to comment.