Skip to content
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

feat: support builds from a cargo workspace #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JoelRoxell
Copy link

@JoelRoxell JoelRoxell commented Aug 4, 2022

What did you implement:

Adds a new custom flag to signal that the serverless.yml is nested in a cargo workspace. Since the binaries will be outputted to a target folder in the workspace root, the zip-copy-process needs to take that into account.

Not sure if this is the most appropriate change; however, it solved my problem.

I want to be able to separate the lambda-projects to isolate different dependencies etc.

custom:
  rust:
    dockerless: true
    inWorkspace: true # <---- Defaults to false

How did you verify your change:

Deployed multiple stacks from the workspace root to AWS using serverless components.

.
├── Cargo.lock
├── Cargo.toml
├── shared-infra
│   └── serverless.yml
├── package.json
├── package-lock.json
├── lambda1 # rest api
│   ├── Cargo.toml
│   ├── serverless.yml
│   ├── src
│   │   ├── handler.rs
│   │   └── main.rs
│   └── target
│       └── lambda
│           └── release
│               └── lambda1.zip
├── lambda2 # queue-consumer
│   ├── Cargo.toml
│   ├── serverless.yml
│   ├── src
│   │   ├── handler.rs
│   │   ├── main.rs
│   │   └── messages.rs
│   └── target
│       └── lambda
│           └── release
│               └── lambda2.zip
├── serverless-compose.yml
├── target
│   ├── release
│   └── x86_64-unknown-linux-musl
│       └── release
│           ├── lambda1
│           ├── lambda1.d
│           ├── lambda2
│           └── lambda2.d
└── yarn.lock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant