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
3333*.yaml
3434*.yml
3535**/.npmignore
36- **/*.json
36+ **/*.json
37+ **/*.txt
Original file line number Diff line number Diff line change @@ -7,21 +7,21 @@ let package = Package(
77 name: " ResourcesPackaging " ,
88 platforms: [ . macOS( . v15) ] ,
99 products: [
10- . executable( name: " MyLambda " , targets: [ " MyLambda " ] ) ,
10+ . executable( name: " MyLambda " , targets: [ " MyLambda " ] )
1111 ] ,
1212 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 " )
1414 ] ,
1515 targets: [
1616 . executableTarget(
1717 name: " MyLambda " ,
1818 dependencies: [
19- . product( name: " AWSLambdaRuntime " , package : " swift-aws-lambda-runtime " ) ,
19+ . product( name: " AWSLambdaRuntime " , package : " swift-aws-lambda-runtime " )
2020 ] ,
2121 path: " . " ,
2222 resources: [
23- . process( " hello.txt " ) ,
23+ . process( " hello.txt " )
2424 ]
25- ) ,
25+ )
2626 ]
2727)
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ import Foundation
1717
1818let runtime = LambdaRuntime {
1919 ( 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)
2424}
2525
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
6161sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
6262
6363# Add the current user to the docker group
64- sudo usermod -aG docker $USER
64+ sudo usermod -aG docker " $USER "
6565
6666# LOGOUT and LOGIN to apply the changes
6767exit
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