Skip to content

Commit f2f31a1

Browse files
committed
improve example makefile
1 parent c72834d commit f2f31a1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Examples/quoteapi/Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ builder-bot:
4949
docker build -f Dockerfile . -t swift-builder
5050

5151
# prep directories
52+
rm -rf $($@ARTIFACTS_DIR)
5253
mkdir -p $($@BUILD_DIR)/lambda $($@ARTIFACTS_DIR)
5354

5455
# compile application inside Docker image using source code from local project folder
@@ -58,8 +59,9 @@ builder-bot:
5859
# create lambda bootstrap file
5960
docker run --rm -v $($@BUILD_DIR):/build-target -v `pwd`:/build-src -w /build-src swift-builder bash -cl "cd /build-target/lambda && ln -s $($@PRODUCT) /bootstrap"
6061

61-
# copy binary to stage
62-
cp $($@BUILD_DIR)/release/$($@PRODUCT) $($@STAGE)/bootstrap
63-
64-
# copy app from stage to artifacts dir
65-
cp $($@STAGE)/* $($@ARTIFACTS_DIR)
62+
# copy binary to artifacts dir
63+
cp $($@BUILD_DIR)/release/$($@PRODUCT) $($@ARTIFACTS_DIR)/bootstrap
64+
65+
# copy resources to artifacts dir
66+
[ -d "$($@BUILD_DIR)/release/$($@PRODUCT)_$($@PRODUCT).resources" ] && cp $($@BUILD_DIR)/release/$($@PRODUCT)_$($@PRODUCT).resources/* $($@ARTIFACTS_DIR) || true
67+

0 commit comments

Comments
 (0)