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

Support --no-build for package and deploy #398

Closed
chrissimon-au opened this issue May 20, 2018 · 7 comments · Fixed by #560
Closed

Support --no-build for package and deploy #398

chrissimon-au opened this issue May 20, 2018 · 7 comments · Fixed by #560
Labels
Milestone

Comments

@chrissimon-au
Copy link

This is a Feature Proposal

Description

For feature proposals:

  • What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.

When using yarn workspaces, it's common for a service to depend on modules that are contained within the workspace. In a CI/CD process, we would like to execute a test/build step which produces a deployable artifact (e.g. a zip of the service folder) which can be promoted through various environments. At deploy time, the deployable artifact will not exist within the 'workspaces' structure, so yarn/npm and thus webpack are unable to locate some of the dependencies.

If serverless deploy supported a --no-build option, then we could do:

  1. serverless webpack
  2. zip folder
  3. unzip in prep for deployment to an environment
  4. serverless deploy --no-build -stage qa - this should package and deploy the serverless service using the existing .webpack contents
  • If there is additional config how would it look

N/A

Similar or dependent issue(s):

Additional Data

  • Serverless-Webpack Version you're using: 5.1.5
  • Webpack version you're using: 4.8.1
  • Serverless Framework Version you're using: 1.27.2
  • Operating System: linux
  • Stack Trace (if available): none
@kushanson
Copy link

serverless already supports "--package" option for the "deploy" command. It would make sense for serverless-webpack plugin to be smart when it sees "--package" option and not execute a webpack workflow in this case.

I currently use serverless-webpack to package a '.serverless' folder and then I want to deploy that folder in my release process and there is no need for serverless webpack to do anything at this point in the workflow.

I went ahead and logged a feature request for what I have outlined above:
#546

@beanaroo
Copy link

beanaroo commented Jan 4, 2020

Having the --no-build option would be very useful for deploying when specifying --artifact as opposed to --package

We are employing the approach outlined in this article, for more information.

Currently, removing the plugin from serverless.yml serves as a workaround.

@j0k3r
Copy link
Member

j0k3r commented Nov 20, 2020

This will be available in 5.4.0

@j0k3r j0k3r closed this as completed Nov 20, 2020
@HarshRohila
Copy link

I tried release/5.4.0 branch
--no-build option gives error 'No matching handler found for 'src/handlers/handler' in 'my working dir'

Steps

  1. Clone aws-nodejs-typescript template https://github.com/serverless/serverless/tree/master/lib/plugins/create/templates/aws-nodejs-typescript
  2. npm install and install release/5.4.1 of serverless webpack(npm i -D git://github.com/serverless-heaven/serverless-webpack#release/5.4.0)
  3. sls webpack (creates .zip file in .webpack, with dependencies and service directories)
  4. copy .webpack and package.json and serverless.ts in new directory
  5. npm i && sls deploy --no-build

Throws error 'No matching handler found for 'src/handlers/handler' in 'my working dir'
SLS_DEBUG shows webpack validate step throwing that error

@j0k3r
Copy link
Member

j0k3r commented Feb 4, 2021

That branch does not exist anymore. Use master instead

@HarshRohila
Copy link

That branch does not exist anymore. Use master instead

https://github.com/serverless-heaven/serverless-webpack/tree/release/5.4.0
I used this branch, also I can see changes of the fix done for this
master branch also giving same error

As per @beanaroo suggestion, I added a workaround for removing this plugin from serverless.ts
Workaround is working fine

@j0k3r
Copy link
Member

j0k3r commented Feb 4, 2021

Oh yeah, the branch still exists (sorry). But it's no more up to date with the upcoming 5.4.0.
I didn't removed it to avoid breaking stuff but it's now outdated.

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