Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit c88b0c2

Browse files
Merge pull request #39 from Andrea-Scuderi/feature/swift_5_1_5
Update to Swift 5.1.5
2 parents 6bfb6fd + 8ceb692 commit c88b0c2

File tree

15 files changed

+110
-21
lines changed

15 files changed

+110
-21
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ deploy:
6565
provider: releases
6666
api_key:
6767
secure: Ddgpz/LsTWeTTr8Xm0br+Vs3Is58V2bOHthwLOt5a1TbyhWAgU+tyc6lwvd51mhQxeNNVPSOWLKC4QgJEp2KI2ZCaw0K+Czb8lqMzWF5eJggDmJ0+wOZIHVEWMO7smLTwDc1jWtdnQA3qkPtXgSw0ERcJ9z4/haz1Q8v7Jj5qfoBJiNxnYYvw/79ElqROIjtQ0asX/i6xhZSlBFO1dXo5QPzX7XeNREQmh2dCkjfoeYSFSCah4Tnn5akxX36Pef1DJvWdFvc623pWAUoCpeswIMW/htby5tJQ6+C9PK+2yzqomKfU9gTK9iv7Nt3X1LN3KsXpk6VHgtljiUkEsecXjYB5WVBT00mY/4bnTPyY6RjI/V6C0aGnTE+0Pj78kDofJKj5uNevFi4vlBI2g4s4G0mRASFRp+sk3ASmzl62Lohkl1LfNiPYKRKRA2jT81s79zBnYv/MQ7t3fY+yd7iP+NrJfDFR/XG0vxBOQrNRpq6LR0M7DeHgTD/d9an2WEqJlX9pp+Ji/ywwepW7b/NLv42xeN99SnHbDmJJ/eZ4P1IC37JCOT5CjJ9wIyP8c+Q89JT30nlvON9xPM8MOx/MrVAGCeqC6FW1Zjc6oakTRZdngMqN1acH5OosLX83cOjjXo8ivRt5Sm2tfX3ZuOgL98kdaYsIBPIYbYhZDODdvM=
68-
file: ".build/layer/swift-lambda-runtime-5-1-4.zip"
68+
file: ".build/layer/swift-lambda-runtime-5-1-5.zip"
6969
skip_cleanup: true
7070
on:
7171
tags: true

Examples/HTTPSRequest/.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nio-swift:5.1.4
1+
FROM nio-swift:5.1.5
22

33
# Or your actual UID, GID on Linux if not the default 1000
44
ARG USERNAME=vscode

Examples/HTTPSRequest/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HTTPSRequest
22

3-
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.4](https://img.shields.io/badge/Swift-5.1.4-blue.svg)](https://swift.org/download/)
3+
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.5](https://img.shields.io/badge/Swift-5.1.5-blue.svg)](https://swift.org/download/)
44

55
This example shows the usage of the [LambdaSwiftSprinter](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) framework and the plugin [LambdaSwiftSprinterNioPlugin](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin) to build a lambda capable to perform an HTTPS request.
66

Examples/HelloWorld/.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nio-swift:5.1.4
1+
FROM nio-swift:5.1.5
22

33
# Or your actual UID, GID on Linux if not the default 1000
44
ARG USERNAME=vscode

Examples/HelloWorld/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HelloWorld
22

3-
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.4](https://img.shields.io/badge/Swift-5.1.4-blue.svg)](https://swift.org/download/)
3+
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.5](https://img.shields.io/badge/Swift-5.1.5-blue.svg)](https://swift.org/download/)
44

55
This example shows the usage of the [LambdaSwiftSprinter](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) framework to build a simple lambda.
66

Examples/PostgreSQLDemo/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PostgreSQLDemo
22

3-
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.4](https://img.shields.io/badge/Swift-5.1.4-blue.svg)](https://swift.org/download/)
3+
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.5](https://img.shields.io/badge/Swift-5.1.5-blue.svg)](https://swift.org/download/)
44

55
This example shows the usage of the [LambdaSwiftSprinter](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) framework and the plugin [LambdaSwiftSprinterNioPlugin](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin) to build a lambda capable to perform an Postgres query using
66
[PostgresNIO](https://github.com/vapor/postgres-nio.git).

Examples/RedisDemo/Package.resolved

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "async-http-client",
6+
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
7+
"state": {
8+
"branch": null,
9+
"revision": "e2636a4c24e646d3e480fc666da0c090818beb09",
10+
"version": "1.1.0"
11+
}
12+
},
13+
{
14+
"package": "LambdaSwiftSprinter",
15+
"repositoryURL": "https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core",
16+
"state": {
17+
"branch": null,
18+
"revision": "6941e41194bde0e57fb0deb23be620f2b8dd626d",
19+
"version": "1.0.0"
20+
}
21+
},
22+
{
23+
"package": "LambdaSwiftSprinterNioPlugin",
24+
"repositoryURL": "https://github.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin",
25+
"state": {
26+
"branch": null,
27+
"revision": "35d3ab84bf83fc881844b5f7483cb2a1d942a23f",
28+
"version": "1.0.1"
29+
}
30+
},
31+
{
32+
"package": "swift-log",
33+
"repositoryURL": "https://github.com/apple/swift-log.git",
34+
"state": {
35+
"branch": null,
36+
"revision": "74d7b91ceebc85daf387ebb206003f78813f71aa",
37+
"version": "1.2.0"
38+
}
39+
},
40+
{
41+
"package": "swift-metrics",
42+
"repositoryURL": "https://github.com/apple/swift-metrics.git",
43+
"state": {
44+
"branch": null,
45+
"revision": "708b960b4605abb20bc55d65abf6bad607252200",
46+
"version": "2.0.0"
47+
}
48+
},
49+
{
50+
"package": "swift-nio",
51+
"repositoryURL": "https://github.com/apple/swift-nio.git",
52+
"state": {
53+
"branch": null,
54+
"revision": "a27a07719ca785bcaca019a5b9fe1814b981b4a2",
55+
"version": "2.15.0"
56+
}
57+
},
58+
{
59+
"package": "swift-nio-extras",
60+
"repositoryURL": "https://github.com/apple/swift-nio-extras.git",
61+
"state": {
62+
"branch": null,
63+
"revision": "b4dbfacff47fb8d0f9e0a422d8d37935a9f10570",
64+
"version": "1.4.0"
65+
}
66+
},
67+
{
68+
"package": "swift-nio-ssl",
69+
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
70+
"state": {
71+
"branch": null,
72+
"revision": "af46d9b58fafbb76f9b01177568d435a1b024f99",
73+
"version": "2.6.2"
74+
}
75+
},
76+
{
77+
"package": "RediStack",
78+
"repositoryURL": "https://gitlab.com/mordil/swift-redi-stack.git",
79+
"state": {
80+
"branch": null,
81+
"revision": "b08ad5461af53276020a21c7fa66fa1237eea723",
82+
"version": "1.0.0-alpha.8"
83+
}
84+
}
85+
]
86+
},
87+
"version": 1
88+
}

Examples/RedisDemo/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RedisDemo
22

3-
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.4](https://img.shields.io/badge/Swift-5.1.4-blue.svg)](https://swift.org/download/)
3+
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.5](https://img.shields.io/badge/Swift-5.1.5-blue.svg)](https://swift.org/download/)
44

55
This example shows the usage of the [LambdaSwiftSprinter](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) framework and the plugin [LambdaSwiftSprinterNioPlugin](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-nio-plugin) to build a lambda capable to perform an Redis request using
66
[RediStack](https://gitlab.com/mordil/swift-redi-stack.git).

Examples/RedisDemo/Sources/RedisDemo/main.swift

+5-4
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ let connection = try? RedisConnection.connect(
5252

5353
let syncCodableNIOLambda: SyncCodableNIOLambda<Event, Response> = { (event, context) throws -> EventLoopFuture<Response> in
5454

55-
guard let connection = connection else {
55+
guard let connection = connection,
56+
let key = RedisKey(rawValue: event.key) else {
5657
throw LambdaError.redisConnectionFailed
5758
}
5859

59-
let future = connection.set(event.key, to: event.value)
60-
.flatMap {
61-
return connection.get(event.key)
60+
let future = connection.set(key, to: event.value)
61+
.flatMap { _ in
62+
return connection.get(key)
6263
}
6364
.map { content -> Response in
6465
return Response(value: content ?? "")

Examples/S3Test/.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nio-swift:5.1.4
1+
FROM nio-swift:5.1.5
22

33
# Or your actual UID, GID on Linux if not the default 1000
44
ARG USERNAME=vscode

Examples/S3Test/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# S3Test
22

3-
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.4](https://img.shields.io/badge/Swift-5.1.4-blue.svg)](https://swift.org/download/)
3+
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.5](https://img.shields.io/badge/Swift-5.1.5-blue.svg)](https://swift.org/download/)
44

55
This example shows the usage of the [LambdaSwiftSprinter](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) framework with the third-party library [https://github.com/swift-aws/aws-sdk-swift.git](https://github.com/swift-aws/aws-sdk-swift.git) to build a lambda capable to perform an HTTPS request to an S3 Bucket.
66

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
# Use this tag to build a customized local image
33

4-
SWIFT_VERSION?=5.1.4
5-
LAYER_VERSION?=5-1-4
4+
SWIFT_VERSION?=5.1.5
5+
LAYER_VERSION?=5-1-5
66
# SWIFT_VERSION=5.0.3
77
# LAYER_VERSION=5-0-3
88
DOCKER_TAG=nio-swift:$(SWIFT_VERSION)

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# aws-lambda-swift-sprinter
22

3-
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.4](https://img.shields.io/badge/Swift-5.1.4-blue.svg)](https://swift.org/download/) ![](https://img.shields.io/badge/version-1.0.0-green) ![](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter.svg?branch=master) ![](https://img.shields.io/badge/@AWS-Open-orange.svg)
3+
[![Swift 5](https://img.shields.io/badge/Swift-5.0-blue.svg)](https://swift.org/download/) [![Swift 5.1.5](https://img.shields.io/badge/Swift-5.1.5-blue.svg)](https://swift.org/download/) ![](https://img.shields.io/badge/version-1.0.0-green) ![](https://travis-ci.com/swift-sprinter/aws-lambda-swift-sprinter.svg?branch=master) ![](https://img.shields.io/badge/@AWS-Open-orange.svg)
44

55
![](./images/aws-lambda-swift-sprinter.png)
66

@@ -175,8 +175,8 @@ make invoke_lambda \
175175
| AWS_PROFILE | An AWS AIM profile you create to authenticate to your account. | default |
176176
| IAM_ROLE_NAME | The execution role created that will be assumed by the Lambda. | lambda_sprinter_basic_execution |
177177
| AWS_BUCKET | The AWS S3 bucket where the layer and lambdas zip files get uploaded. | aws-lambda-swift-sprinter |
178-
| SWIFT_VERSION | Version of Swift used / Matches Dockerfile location too from `docker/` folder. | 5.1.4 |
179-
| LAYER_VERSION | Version of the Swift layer that will be created and uploaded for the Lambda to run on. | 5-1-4 |
178+
| SWIFT_VERSION | Version of Swift used / Matches Dockerfile location too from `docker/` folder. | 5.1.5 |
179+
| LAYER_VERSION | Version of the Swift layer that will be created and uploaded for the Lambda to run on. | 5-1-5 |
180180
| SWIFT_EXECUTABLE | Name of the binary file. | HelloWorld |
181181
| SWIFT_PROJECT_PATH | Path to your Swift project. | Examples/HelloWorld |
182182
| LAMBDA_FUNCTION_NAME | Display name of your Lambda in AWS. | HelloWorld |
@@ -459,8 +459,8 @@ Stop the docker-compose test environment
459459

460460
### Configure:
461461
- Go to `AWS Lambda -> Layers` in AWS Console and create a new layer from scratch
462-
- Enter layer name "swift-lambda-runtime-5-1-4"
463-
- Upload the zip file `build/swift-lambda-runtime-5-1-4.zip`
462+
- Enter layer name "swift-lambda-runtime-5-1-5"
463+
- Upload the zip file `build/swift-lambda-runtime-5-1-5.zip`
464464
- Leave "Compatible runtimes" empty.
465465
- Click "Create"
466466
- Copy the `arn` from the created layer, it's required to set up the lambda.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM swift:5.1.4 as builder
1+
FROM swift:5.1.5 as builder
22

33
RUN apt-get -qq update && apt-get -q -y install \
44
libssl-dev libicu-dev

0 commit comments

Comments
 (0)