From 7fa7c53df7a3d14077773256c3bbd30e7b8bac35 Mon Sep 17 00:00:00 2001 From: Adolfo Date: Wed, 22 Feb 2023 13:14:14 +0100 Subject: [PATCH 1/2] Archive command options documentation Show the options that the new `archive` plugin provides to customize the operation behavior. --- readme.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/readme.md b/readme.md index 7aac6068..95a694fb 100644 --- a/readme.md +++ b/readme.md @@ -185,8 +185,25 @@ To build and package your Lambda, run the following command: swift package archive ``` +The `archive` command can be customized using the following parameters + +* `--output-path` A valid file system path where a folder with the archive operation result will be placed. This folder will contains the following elements: + * A file link named `bootstrap` + * An executable file + * A **Zip** file ready to be upload to AWS +* `--verbose` A number that sets the command output detail level between the following values: + * `0` (Silent) + * `1` (Output) + * `2` (Debug) +* `--swift-version` Swift language version used to define the Amazon Linux 2 Docker image. For example "5.7.3" +* `--base-docker-image` An Amazon Linux 2 docker image name available in your system. + +Both `--swift-version` and `--base-docker-image` are mutually exclusive + on macOS, the archiving plugin uses docker to build the Lambda for Amazon Linux 2, and as such requires to communicate with Docker over the localhost network. At the moment, SwiftPM does not allow plugin communication over network, and as such the invocation requires breaking from the SwiftPM plugin sandbox. This limitation would be removed in the future. + + ```shell swift package --disable-sandbox archive From 77543624b762b94b34c5b2f1bf33290f123f455a Mon Sep 17 00:00:00 2001 From: Adolfo Date: Wed, 22 Feb 2023 13:23:47 +0100 Subject: [PATCH 2/2] Archive command example Provide an example with the `archive` command taking two parameters --- readme.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/readme.md b/readme.md index 95a694fb..d1c8f3fc 100644 --- a/readme.md +++ b/readme.md @@ -200,6 +200,14 @@ The `archive` command can be customized using the following parameters Both `--swift-version` and `--base-docker-image` are mutually exclusive +Here's an example + +```zsh +swift package archive --output-path /Users/JohnAppleseed/Desktop --verbose 2 +``` + +This command execution will generate a folder at `/Users/JohnAppleseed/Desktop` with the lambda zipped and ready to upload it and set the command detail output level to `2` (debug) + on macOS, the archiving plugin uses docker to build the Lambda for Amazon Linux 2, and as such requires to communicate with Docker over the localhost network. At the moment, SwiftPM does not allow plugin communication over network, and as such the invocation requires breaking from the SwiftPM plugin sandbox. This limitation would be removed in the future.