Skip to content
Open
Show file tree
Hide file tree
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
feat: support builds from a cargo workspace
  • Loading branch information
JoelRoxell committed Aug 4, 2022
commit f1953fef3ffb3f2b913b170dde738fe63b5db592
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class RustPlugin {
dockerTag: DEFAULT_DOCKER_TAG,
dockerImage: DEFAULT_DOCKER_IMAGE,
dockerless: false,
inWorkspace: false,
},
(this.serverless.service.custom && this.serverless.service.custom.rust) ||
{}
Expand Down Expand Up @@ -167,7 +168,7 @@ class RustPlugin {
const zip = new AdmZip();
zip.addFile(
"bootstrap",
readFileSync(path.join(sourceDir, binary)),
readFileSync(path.join(this.custom.inWorkspace ? '..' : '', sourceDir, binary)),
"",
0o755
);
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe("RustPlugin", () => {
dockerImage: "softprops/lambda-rust",
dockerTag: "latest",
dockerless: false,
inWorkspace: false
});
});

Expand All @@ -54,6 +55,7 @@ describe("RustPlugin", () => {
dockerImage: "notsoftprops/lambda-rust",
dockerTag: "custom-tag",
dockerless: true,
inWorkspace: false
},
},
package: {},
Expand All @@ -67,6 +69,7 @@ describe("RustPlugin", () => {
dockerImage: "notsoftprops/lambda-rust",
dockerTag: "custom-tag",
dockerless: true,
inWorkspace: false
});
});

Expand Down