Skip to content

Commit 7198852

Browse files
authored
Merge pull request #68 from aklitzke/master
Allow root path of build to be different than the directory the serverless yaml is in.
2 parents 1a228bb + e7bb7f9 commit 7198852

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class RustPlugin {
4444
{}
4545
);
4646

47+
this.dockerPath = path.resolve(this.custom.dockerPath || this.servicePath);
48+
4749
// By default, Serverless examines node_modules to figure out which
4850
// packages there are from dependencies versus devDependencies of a
4951
// package. While there will always be a node_modules due to Serverless
@@ -65,7 +67,7 @@ class RustPlugin {
6567
'-e',
6668
`BIN=${binary}`,
6769
`-v`,
68-
`${this.servicePath}:/code`,
70+
`${this.dockerPath}:/code`,
6971
`-v`,
7072
`${cargoRegistry}:/root/.cargo/registry`,
7173
`-v`,
@@ -150,6 +152,7 @@ class RustPlugin {
150152
// see https://serverless.com/framework/docs/providers/aws/guide/packaging/
151153
// for more information
152154
const artifactPath = path.join(
155+
this.dockerPath,
153156
`target/lambda/${"dev" === profile ? "debug" : "release"}`,
154157
binary + ".zip"
155158
);

0 commit comments

Comments
 (0)