File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
33cli=" ./bin/faas-cli"
4- template=" python3"
4+
5+ TEMPLATE_NAME=" python3-http"
56
67get_package () {
78 uname=$( uname)
@@ -22,21 +23,20 @@ get_package() {
2223 case $arch in
2324 " armv6l" | " armv7l" )
2425 cli=" ./faas-cli-armhf"
25- template=" python3-armhf"
2626 ;;
2727 esac
2828 ;;
2929 esac
3030
3131 echo " Using package $cli "
32- echo " Using template $template "
32+ echo " Using template $TEMPLATE_NAME "
3333}
3434
3535build_faas_function () {
3636
3737 function_name=$1
3838
39- eval $cli new $function_name --lang $template
39+ eval $cli new $function_name --lang $TEMPLATE_NAME
4040
4141cat << EOF > $function_name /handler.py
4242def handle(req):
120120 rm -rf got.txt want.txt $function_name *
121121}
122122
123+ get_templates () {
124+ echo " Getting templates..."
125+ eval $cli template pull $TEMPLATE_NAME
126+ }
127+
128+ get_templates
129+
123130get_package
124131build_faas_function $FUNCTION
125132run_and_test $FUNCTION $PORT $FUNCTION_UP_TIMEOUT
You can’t perform that action at this time.
0 commit comments