Skip to content

Commit 14ef7fe

Browse files
Restore scripts under Example/LambdaFunctions
1 parent ee36b6d commit 14ef7fe

18 files changed

+20
-29
lines changed
File renamed without changes.

Examples/scripts/SAM/APIGateway-template.yml renamed to Examples/LambdaFunctions/scripts/SAM/APIGateway-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Properties:
1010
Handler: Provided
1111
Runtime: provided
12-
CodeUri: LambdaFunctions/.build/lambda/APIGateway/lambda.zip
12+
CodeUri: .build/lambda/APIGateway/lambda.zip
1313
# Add an API Gateway event source for the Lambda
1414
Events:
1515
HttpGet:

Examples/scripts/SAM/Benchmark-template.yml renamed to Examples/LambdaFunctions/scripts/SAM/Benchmark-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Resources:
99
Properties:
1010
Handler: Provided
1111
Runtime: provided
12-
CodeUri: LambdaFunctions/.build/lambda/Benchmark/lambda.zip
12+
CodeUri: .build/lambda/Benchmark/lambda.zip
1313
# Instructs new versions to be published to an alias named "live".
1414
AutoPublishAlias: live

Examples/scripts/SAM/CurrencyExchange-template.yml renamed to Examples/LambdaFunctions/scripts/SAM/CurrencyExchange-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Resources:
99
Properties:
1010
Handler: Provided
1111
Runtime: provided
12-
CodeUri: LambdaFunctions/.build/lambda/CurrencyExchange/lambda.zip
12+
CodeUri: .build/lambda/CurrencyExchange/lambda.zip
1313
Timeout: 300
1414
# Instructs new versions to be published to an alias named "live".
1515
AutoPublishAlias: live

Examples/scripts/SAM/ErrorHandling-template.yml renamed to Examples/LambdaFunctions/scripts/SAM/ErrorHandling-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Resources:
99
Properties:
1010
Handler: Provided
1111
Runtime: provided
12-
CodeUri: LambdaFunctions/.build/lambda/ErrorHandling/lambda.zip
12+
CodeUri: .build/lambda/ErrorHandling/lambda.zip
1313
# Instructs new versions to be published to an alias named "live".
1414
AutoPublishAlias: live

Examples/scripts/SAM/HelloWorld-template.yml renamed to Examples/LambdaFunctions/scripts/SAM/HelloWorld-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Resources:
99
Properties:
1010
Handler: Provided
1111
Runtime: provided
12-
CodeUri: LambdaFunctions/.build/lambda/HelloWorld/lambda.zip
12+
CodeUri: .build/lambda/HelloWorld/lambda.zip
1313
# Instructs new versions to be published to an alias named "live".
1414
AutoPublishAlias: live

Examples/scripts/build-and-package.sh renamed to Examples/LambdaFunctions/scripts/build-and-package.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@
1616
set -eu
1717

1818
executable=$1
19-
workspace="$(pwd)/.."
20-
sources=$2
19+
workspace="$(pwd)/../.."
2120

2221
echo "-------------------------------------------------------------------------"
2322
echo "building \"$executable\" lambda"
2423
echo "-------------------------------------------------------------------------"
25-
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/$sources builder bash -cl "swift build --product $executable -c release -Xswiftc -g"
24+
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder bash -cl "swift build --product $executable -c release -Xswiftc -g"
2625
echo "done"
2726

2827
echo "-------------------------------------------------------------------------"
2928
echo "packaging \"$executable\" lambda"
3029
echo "-------------------------------------------------------------------------"
31-
docker run --rm -v "$workspace":/workspace -w /workspace/Examples builder bash -cl "./scripts/package.sh $executable $sources"
30+
docker run --rm -v "$workspace":/workspace -w /workspace/Examples/LambdaFunctions builder bash -cl "./scripts/package.sh $executable"

Examples/scripts/config.sh renamed to Examples/LambdaFunctions/scripts/config.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515

1616
DIR="$(cd "$(dirname "$0")" && pwd)"
1717

18-
sources="LambdaFunctions"
19-
20-
cd $sources
2118
executables=( $(swift package dump-package | sed -e 's|: null|: ""|g' | jq '.products[] | (select(.type.executable)) | .name' | sed -e 's|"||g') )
22-
cd ..
2319

2420
if [[ ${#executables[@]} = 0 ]]; then
2521
echo "no executables found"
@@ -39,6 +35,5 @@ echo "-------------------------------------------------------------------------"
3935
echo "CONFIG"
4036
echo "-------------------------------------------------------------------------"
4137
echo "DIR: $DIR"
42-
echo "sources: $sources"
4338
echo "executable: $executable"
4439
echo "-------------------------------------------------------------------------"

Examples/scripts/deploy.sh renamed to Examples/LambdaFunctions/scripts/deploy.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ lambda_name=SwiftSample
2121
# S3 bucket name to upload zip file (must exist in AWS S3)
2222
s3_bucket=swift-lambda-test
2323

24-
workspace="$(pwd)/.."
25-
26-
sources="LambdaFunctions"
24+
workspace="$(pwd)/../.."
2725

2826
DIR="$(cd "$(dirname "$0")" && pwd)"
2927
source $DIR/config.sh
@@ -46,13 +44,13 @@ echo "done"
4644
echo "-------------------------------------------------------------------------"
4745
echo "packaging \"$executable\" lambda"
4846
echo "-------------------------------------------------------------------------"
49-
docker run --rm -v "$workspace/Examples":/workspace -w /workspace builder bash -cl "./scripts/package.sh $executable $sources"
47+
docker run --rm -v `pwd`:/workspace -w /workspace builder bash -cl "./scripts/package.sh $executable"
5048

5149
echo "-------------------------------------------------------------------------"
5250
echo "uploading \"$executable\" lambda to s3"
5351
echo "-------------------------------------------------------------------------"
5452

55-
aws s3 cp $sources/.build/lambda/$executable/lambda.zip s3://$s3_bucket/
53+
aws s3 cp .build/lambda/$executable/lambda.zip s3://$s3_bucket/
5654

5755
echo "-------------------------------------------------------------------------"
5856
echo "updating \"$lambda_name\" to latest \"$executable\""

Examples/scripts/package.sh renamed to Examples/LambdaFunctions/scripts/package.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
set -eu
1717

1818
executable=$1
19-
sources=$2
2019

21-
target=$sources/.build/lambda/$executable
20+
target=.build/lambda/$executable
2221
rm -rf "$target"
2322
mkdir -p "$target"
24-
cp "$sources/.build/release/$executable" "$target/"
23+
cp ".build/release/$executable" "$target/"
2524
cp -Pv /usr/lib/swift/linux/lib*so* "$target"
2625
cd "$target"
2726
ln -s "$executable" "bootstrap"

Examples/scripts/sam-deploy.sh renamed to Examples/LambdaFunctions/scripts/sam-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo "preparing docker build image"
2323
echo "-------------------------------------------------------------------------"
2424
docker build . -q -t builder
2525

26-
$DIR/build-and-package.sh ${executable} ${sources}
26+
$DIR/build-and-package.sh ${executable}
2727

2828
echo "-------------------------------------------------------------------------"
2929
echo "deploying using SAM"

Examples/scripts/serverless-deploy.sh renamed to Examples/LambdaFunctions/scripts/serverless-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo "preparing docker build image"
2323
echo "-------------------------------------------------------------------------"
2424
docker build . -q -t builder
2525

26-
$DIR/build-and-package.sh ${executable} ${sources}
26+
$DIR/build-and-package.sh ${executable}
2727

2828
echo "-------------------------------------------------------------------------"
2929
echo "deploying using Serverless"

Examples/scripts/serverless/APIGateway-template.yml renamed to Examples/LambdaFunctions/scripts/serverless/APIGateway-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
service: apigateway-swift-aws
22

33
package:
4-
artifact: LambdaFunctions/.build/lambda/APIGateway/lambda.zip
4+
artifact: .build/lambda/APIGateway/lambda.zip
55

66
provider:
77
name: aws

Examples/scripts/serverless/Benchmark-template.yml renamed to Examples/LambdaFunctions/scripts/serverless/Benchmark-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
service: benchmark-swift-aws
22

33
package:
4-
artifact: LambdaFunctions/.build/lambda/Benchmark/lambda.zip
4+
artifact: .build/lambda/Benchmark/lambda.zip
55

66
provider:
77
name: aws

Examples/scripts/serverless/CurrencyExchange-template.yml renamed to Examples/LambdaFunctions/scripts/serverless/CurrencyExchange-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
service: currency-swift-aws
22

33
package:
4-
artifact: LambdaFunctions/.build/lambda/CurrencyExchange/lambda.zip
4+
artifact: .build/lambda/CurrencyExchange/lambda.zip
55

66
provider:
77
name: aws

Examples/scripts/serverless/ErrorHandling-template.yml renamed to Examples/LambdaFunctions/scripts/serverless/ErrorHandling-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
service: errorhandling-swift-aws
22

33
package:
4-
artifact: LambdaFunctions/.build/lambda/ErrorHandling/lambda.zip
4+
artifact: .build/lambda/ErrorHandling/lambda.zip
55

66
provider:
77
name: aws

Examples/scripts/serverless/HelloWorld-template.yml renamed to Examples/LambdaFunctions/scripts/serverless/HelloWorld-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
service: helloworld-swift-aws
22

33
package:
4-
artifact: LambdaFunctions/.build/lambda/HelloWorld/lambda.zip
4+
artifact: .build/lambda/HelloWorld/lambda.zip
55

66
provider:
77
name: aws

0 commit comments

Comments
 (0)