Files
swift-aws-lambda-runtime/Examples/LocalDebugging/MyLambda/scripts/package.sh
T
tomer doron b9224e2fb6 examples deployment scripts refresh (#133)
motivation: make sure examples are up tp date

changes:
* use swift:5.2 images instead of nighlies
* compute dependencies to make zipfile as small as possible
* make scripts more consistent
2020-06-25 13:38:25 -07:00

29 lines
883 B
Bash
Executable File

#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the SwiftAWSLambdaRuntime open source project
##
## Copyright (c) 2020 Apple Inc. and the SwiftAWSLambdaRuntime project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##
set -eu
executable=$1
target=".build/lambda/$executable"
rm -rf "$target"
mkdir -p "$target"
cp ".build/release/$executable" "$target/"
# add the target deps based on ldd
ldd ".build/release/$executable" | grep swift | awk '{print $3}' | xargs cp -Lv -t "$target"
cd "$target"
ln -s "$executable" "bootstrap"
zip --symlinks lambda.zip *