mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-06-02 07:27:33 +00:00
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
40 lines
1.5 KiB
Bash
Executable File
40 lines
1.5 KiB
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
|
|
workspace="$(pwd)/../.."
|
|
|
|
echo "-------------------------------------------------------------------------"
|
|
echo "preparing docker build image"
|
|
echo "-------------------------------------------------------------------------"
|
|
docker build . -t builder
|
|
echo "done"
|
|
|
|
echo "-------------------------------------------------------------------------"
|
|
echo "building \"$executable\" lambda"
|
|
echo "-------------------------------------------------------------------------"
|
|
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder \
|
|
bash -cl "swift build --product $executable -c release"
|
|
echo "done"
|
|
|
|
echo "-------------------------------------------------------------------------"
|
|
echo "packaging \"$executable\" lambda"
|
|
echo "-------------------------------------------------------------------------"
|
|
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder \
|
|
bash -cl "./scripts/package.sh $executable"
|
|
echo "done"
|