Files
fission-src/environments/go/builder/build.sh
T
Soam VasaniandGitHub d9b5c2e560 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)
2018-02-08 18:55:49 -08:00

20 lines
411 B
Bash
Executable File

#!/bin/sh
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