Skip to content

Commit

Permalink
fix(Packaging): Fix package.artifact validation for S3 urls
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Jul 8, 2021
1 parent a2f7c00 commit ab3c543
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/plugins/package/lib/packageService.js
Expand Up @@ -6,6 +6,7 @@ const globby = require('globby');
const _ = require('lodash');
const micromatch = require('micromatch');
const ServerlessError = require('../../../serverless-error');
const parseS3URI = require('../../aws/utils/parse-s3-uri');

module.exports = {
defaultExcludes: [
Expand Down Expand Up @@ -77,6 +78,7 @@ module.exports = {
return;
}
if (functionObject.package.artifact) {
if (parseS3URI(functionObject.package.artifact)) return;
try {
await fsp.access(
path.resolve(this.serverless.serviceDir, functionObject.package.artifact)
Expand Down Expand Up @@ -109,6 +111,7 @@ module.exports = {
await Promise.all(packagePromises);
if (shouldPackageService) {
if (this.serverless.service.package.artifact) {
if (parseS3URI(this.serverless.service.package.artifact)) return;
try {
await fsp.access(
path.resolve(this.serverless.serviceDir, this.serverless.service.package.artifact)
Expand Down

0 comments on commit ab3c543

Please sign in to comment.