Skip to content

Commit 0c8bc2b

Browse files
committed
make buildstep packageLambdaFunction part of the standard build process
this change uses the opt-out mechanism (SKIP_<step>) instead of awkwardly adding the Lambda step after the last step in the process.
1 parent 7a0a995 commit 0c8bc2b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

build-go-project.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ standardBuildProcess() {
182182

183183
buildstep tests
184184

185+
buildstep packageLambdaFunction
186+
185187
if [ ! -z ${GOFMT_TARGETS+x} ]; then
186188
echo "ERROR: GOFMT_TARGETS is deprecated"
187189
exit 1
@@ -216,7 +218,7 @@ function packageLambdaFunction {
216218
#
217219
# so the new style is to just invoke this script with args.
218220
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
219-
awsLambdaZip=false
221+
SKIP_PACKAGELAMBDAFUNCTION=y
220222

221223
# we don't use short options but "-o" needs to be set, otherwise it mysteriously just doesn't work...
222224
options=$(getopt -l "directory:,binary-basename:,aws-lambda-zip" -o "" -a -- "$@")
@@ -235,7 +237,7 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
235237
export BINARY_NAME="$1"
236238
;;
237239
--aws-lambda-zip)
238-
awsLambdaZip=true
240+
unset SKIP_PACKAGELAMBDAFUNCTION
239241
;;
240242
--)
241243
shift
@@ -251,8 +253,4 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
251253
FRIENDLY_REV_ID=${FRIENDLY_REV_ID:-dev}
252254

253255
standardBuildProcess
254-
255-
if [ $awsLambdaZip = true ] ; then
256-
buildstep packageLambdaFunction
257-
fi
258256
fi

0 commit comments

Comments
 (0)