File tree Expand file tree Collapse file tree 5 files changed +41
-12
lines changed
Examples/ResourcesPackaging Expand file tree Collapse file tree 5 files changed +41
-12
lines changed Original file line number Diff line number Diff line change @@ -33,4 +33,5 @@ Package.resolved
33
33
*.yaml
34
34
*.yml
35
35
**/.npmignore
36
- **/*.json
36
+ **/*.json
37
+ **/*.txt
Original file line number Diff line number Diff line change @@ -7,21 +7,21 @@ let package = Package(
7
7
name: " ResourcesPackaging " ,
8
8
platforms: [ . macOS( . v15) ] ,
9
9
products: [
10
- . executable( name: " MyLambda " , targets: [ " MyLambda " ] ) ,
10
+ . executable( name: " MyLambda " , targets: [ " MyLambda " ] )
11
11
] ,
12
12
dependencies: [
13
- . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , branch: " main " ) ,
13
+ . package ( url: " https://github.com/swift-server/swift-aws-lambda-runtime.git " , branch: " main " )
14
14
] ,
15
15
targets: [
16
16
. executableTarget(
17
17
name: " MyLambda " ,
18
18
dependencies: [
19
- . product( name: " AWSLambdaRuntime " , package : " swift-aws-lambda-runtime " ) ,
19
+ . product( name: " AWSLambdaRuntime " , package : " swift-aws-lambda-runtime " )
20
20
] ,
21
21
path: " . " ,
22
22
resources: [
23
- . process( " hello.txt " ) ,
23
+ . process( " hello.txt " )
24
24
]
25
- ) ,
25
+ )
26
26
]
27
27
)
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ import Foundation
17
17
18
18
let runtime = LambdaRuntime {
19
19
( event: String , context: LambdaContext ) in
20
- guard let fileURL = Bundle . module. url ( forResource: " hello " , withExtension: " txt " ) else {
21
- fatalError ( " no file url " )
22
- }
23
- return try String ( contentsOf: fileURL, encoding: . utf8)
20
+ guard let fileURL = Bundle . module. url ( forResource: " hello " , withExtension: " txt " ) else {
21
+ fatalError ( " no file url " )
22
+ }
23
+ return try String ( contentsOf: fileURL, encoding: . utf8)
24
24
}
25
25
26
- try await runtime. run ( )
26
+ try await runtime. run ( )
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ sudo apt-get update
61
61
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
62
62
63
63
# Add the current user to the docker group
64
- sudo usermod -aG docker $USER
64
+ sudo usermod -aG docker " $USER "
65
65
66
66
# LOGOUT and LOGIN to apply the changes
67
67
exit
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # #===----------------------------------------------------------------------===##
3
+ # #
4
+ # # This source file is part of the SwiftAWSLambdaRuntime open source project
5
+ # #
6
+ # # Copyright (c) 2025 Apple Inc. and the SwiftAWSLambdaRuntime project authors
7
+ # # Licensed under Apache License v2.0
8
+ # #
9
+ # # See LICENSE.txt for license information
10
+ # # See CONTRIBUTORS.txt for the list of SwiftAWSLambdaRuntime project authors
11
+ # #
12
+ # # SPDX-License-Identifier: Apache-2.0
13
+ # #
14
+ # #===----------------------------------------------------------------------===##
15
+
16
+ # Connect with ssh
17
+
18
+ export PATH=/home/ubuntu/swift-6.0.3-RELEASE-ubuntu24.04-aarch64/usr/bin:" ${PATH} "
19
+
20
+ # clone a project
21
+ git clone https://github.com/swift-server/swift-aws-lambda-runtime.git
22
+
23
+ # be sure Swift is install.
24
+ # Youc an install swift with the following command: ./scripts/ubuntu-install-swift.sh
25
+
26
+ # build the project
27
+ cd swift-aws-lambda-runtime/Examples/ResourcesPackaging/ || exit 1
28
+ LAMBDA_USE_LOCAL_DEPS=../.. swift package archive --allow-network-connections docker
You can’t perform that action at this time.
0 commit comments