Go builder for single file functions (#492)
Add support to go builder for building a single file (otherwise even a single file needs to be archived in a .zip)
This commit is contained in:
@@ -1,4 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd ${SRC_PKG}
|
||||
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
|
||||
if [ -d ${SRC_PKG} ]
|
||||
then
|
||||
echo "Building in directory ${SRC_PKG}"
|
||||
cd ${SRC_PKG}
|
||||
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
|
||||
elif [ -f ${SRC_PKG} ]
|
||||
then
|
||||
fn=$(basename ${SRC_PKG})
|
||||
d=/tmp/$fn
|
||||
mkdir $d
|
||||
trap "rm -rf /tmp/$fn" EXIT
|
||||
echo "Building file ${SRC_PKG} in $d"
|
||||
|
||||
cd $d
|
||||
cp ${SRC_PKG} ./function.go
|
||||
go build -buildmode=plugin -i -o ${DEPLOY_PKG} .
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user