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

chore(examples): zero-downtime pm2 typescript example #4907

Merged
merged 6 commits into from
Feb 1, 2019

Conversation

dschewchenko
Copy link

@dschewchenko dschewchenko commented Jan 30, 2019

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

New example

Description

Add process.send('ready') when nuxt server is listening
Resolves #3078
I added simple example with pm2 configuration and use listen hook in nuxt.config for sending ready event to pm2

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@codecov-io
Copy link

codecov-io commented Jan 30, 2019

Codecov Report

Merging #4907 into dev will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #4907      +/-   ##
==========================================
- Coverage   91.79%   91.74%   -0.05%     
==========================================
  Files          73       73              
  Lines        2412     2412              
  Branches      593      593              
==========================================
- Hits         2214     2213       -1     
- Misses        180      181       +1     
  Partials       18       18
Impacted Files Coverage Δ
packages/vue-renderer/src/renderer.js 94.56% <0%> (-0.55%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb13b41...dfa625a. Read the comment docs.

Copy link
Contributor

@kevinmarrec kevinmarrec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR !

I suggested some changes 🙂

Can't wait to be able to have a true zero-downtime PM2 setup 😃

examples/pm2-typescript/package.json Outdated Show resolved Hide resolved
examples/pm2-typescript/package.json Outdated Show resolved Hide resolved
examples/pm2-typescript/tsconfig.json Show resolved Hide resolved
packages/cli/src/commands/start.js Outdated Show resolved Hide resolved
examples/pm2-typescript/pages/index.vue Outdated Show resolved Hide resolved
@kevinmarrec kevinmarrec self-assigned this Jan 30, 2019
@kevinmarrec kevinmarrec changed the title feat zero-downtime using pm2 + example feat: zero-downtime using pm2 + example Jan 30, 2019
@kevinmarrec kevinmarrec removed their assignment Jan 30, 2019
@pimlie
Copy link

pimlie commented Jan 31, 2019

Would it be possible to extend the example to include documentation and/or a command to have zero-downtime while also having to (re)build Nuxt? It seems to me that currently this example is only about zero-downtime while restarting nuxt server but (again it seems, maybe nuxt-ts works differently on start) to skip the build phase?

@dschewchenko
Copy link
Author

Would it be possible to extend the example to include documentation and/or a command to have zero-downtime while also having to (re)build Nuxt? It seems to me that currently this example is only about zero-downtime while restarting nuxt server but (again it seems, maybe nuxt-ts works differently on start) to skip the build phase?

All depends on your need.
Of course, before starting server, you need to build app. It's described in documentation.
Before restarting service you may to deploy all files to temp dir, build there, then move files to your project root, then restart pm2 startOrReload ecosystem.config.js. All described in docs. It's simple.
Recommended steps I will describe in example Readme

@kevinmarrec kevinmarrec changed the title feat: zero-downtime using pm2 + example chore(examples): zero-downtime pm2 typescript example Jan 31, 2019
@kevinmarrec
Copy link
Contributor

kevinmarrec commented Jan 31, 2019

@dschewchenko I changed the title as it's not changing anymore Nuxt core but using the listen hook directly in the example. So it's not a "feature" but a helpful example which we'll be able to link in a proper "PM2 deployment" section or FAQ in documentation.

Thanks for your time ! And thank you @pimlie for the hook tip !

Will test it on my server later this day and approve the PR.

FYI there is a pending PR regarding big perf enhancement using nuxt-ts start on a production server :
#4906

@pi0 pi0 merged commit 1fb9af3 into nuxt:dev Feb 1, 2019
@pi0 pi0 mentioned this pull request Mar 14, 2019
edwh added a commit to Freegle/iznik-nuxt that referenced this pull request Jan 16, 2020
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zero downtime deploy
7 participants