mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
fix: correctly resolve layer package artifact and docker image paths (#12972)
This commit is contained in:
parent
3704754e68
commit
2aea99d345
@ -169,6 +169,7 @@ export default {
|
||||
}
|
||||
return getLambdaLayerArtifactPath(
|
||||
this.packagePath,
|
||||
this.serverless.serviceDir,
|
||||
name,
|
||||
this.provider.serverless.service,
|
||||
this.provider.naming,
|
||||
|
||||
@ -60,6 +60,7 @@ class AwsCompileLayers {
|
||||
let layerLogicalId = this.provider.naming.getLambdaLayerLogicalId(layerName)
|
||||
const layerArtifactPath = getLambdaLayerArtifactPath(
|
||||
this.packagePath,
|
||||
this.serverless.serviceDir,
|
||||
layerName,
|
||||
this.provider.serverless.service,
|
||||
this.provider.naming,
|
||||
|
||||
@ -2424,11 +2424,11 @@ Object.defineProperties(
|
||||
await this.ensureDockerIsAvailable()
|
||||
|
||||
let isDockerfileAvailable = false
|
||||
const pathToDockerfile = path.resolve(
|
||||
const absoluteImagePath = path.resolve(
|
||||
this.serverless.serviceDir,
|
||||
imagePath,
|
||||
imageFilename,
|
||||
)
|
||||
const pathToDockerfile = path.resolve(absoluteImagePath, imageFilename)
|
||||
|
||||
try {
|
||||
const stats = await fsp.stat(pathToDockerfile)
|
||||
@ -2470,7 +2470,7 @@ Object.defineProperties(
|
||||
...buildArgsArr,
|
||||
...cacheFromArr,
|
||||
...buildOptions,
|
||||
imagePath,
|
||||
absoluteImagePath,
|
||||
]
|
||||
|
||||
// These are optional arguments, so we only append to the arguments
|
||||
|
||||
@ -2,15 +2,16 @@ import path from 'path'
|
||||
|
||||
/**
|
||||
* @param packagePath {string}
|
||||
* @param serviceDir {string}
|
||||
* @param layerName {string}
|
||||
* @param service
|
||||
* @param naming
|
||||
* @returns {string}
|
||||
*/
|
||||
export default (packagePath, layerName, service, naming) => {
|
||||
export default (packagePath, serviceDir, layerName, service, naming) => {
|
||||
const layerObject = service.getLayer(layerName)
|
||||
if (layerObject.package && layerObject.package.artifact) {
|
||||
return layerObject.package.artifact
|
||||
return path.resolve(serviceDir, layerObject.package.artifact)
|
||||
}
|
||||
return path.join(packagePath, naming.getLayerArtifactName(layerName))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user