Skip to content

Archive plugin documentation #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,33 @@ 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

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.



```shell
swift package --disable-sandbox archive
Expand Down