serverless-next.js icon indicating copy to clipboard operation
serverless-next.js copied to clipboard

Deploying ... spinner status destroys useful logs when run in a non-interactive shell - like a CICD system

Open mikeputnam opened this issue 4 years ago • 7 comments

Issue Summary

Locally, the Deploying... spinner writes and rewrites the same shell line to give the appearance of a progress bar/status of the deploy. However the same spinner when run in a non-interactive shell (CICD) ends up actually printing every intermediate step of the spinner. This has the effect of pushing all useful build log output many kilobytes into the scrollback.

Actual behavior

  386s › web-ssr › Deploying 
·[NaNA·[G·[J
  386s › web-ssr › Deploying 
·[NaNA·[G·[J
  386s › web-ssr › Deploying 
·[NaNA·[G·[J
  386s › web-ssr › Deploying .
·[NaNA·[G·[J
  386s › web-ssr › Deploying .
·[NaNA·[G·[J
  386s › web-ssr › Deploying ..
·[NaNA·[G·[J
  386s › web-ssr › Deploying ..
·[NaNA·[G·[J
  386s › web-ssr › Deploying ...
·[NaNA·[G·[J
  386s › web-ssr › Deploying ...
·[NaNA·[G·[J
  387s › web-ssr › Deploying 
·[NaNA·[G·[J
  387s › web-ssr › Deploying 
·[NaNA·[G·[J
  387s › web-ssr › Deploying 
·[NaNA·[G·[J
  387s › web-ssr › Deploying .
·[NaNA·[G·[J
  387s › web-ssr › Deploying .
·[NaNA·[G·[J
  387s › web-ssr › Deploying ..
·[NaNA·[G·[J
  387s › web-ssr › Deploying ..
·[NaNA·[G·[J
  387s › web-ssr › Deploying ...
·[NaNA·[G·[J
  387s › web-ssr › Deploying ...
·[NaNA·[G·[J

Expected behavior

It would be great if an argument existed or a default behavior was possible to avoid this non-essential behavior.

Versions

@sls-next/[email protected]

  • OS/Environment: Ubuntu 20.04
  • @sls-next/serverless-component version: @sls-next/[email protected]
  • Next.js version: ^12.0.7

Checklist

  • [x] You have reviewed the README and FAQs, which answers several common questions.
  • [x] You have reviewed our DEBUGGING wiki and have tried your best to include complete information and reproduction steps (including your configuration) as is possible. As there is only one maintainer (who maintains this in his free time) and thus very limited resources, if you have time, please try to debug the issue a bit yourself if possible.
  • [ ] You have first tried using the most recent latest or alpha @sls-next/serverless-component release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.

mikeputnam avatar Jan 24 '22 23:01 mikeputnam

@mikeputnam Best way round this is to deploy it using:

npx @sls-next/serverless-patched --debug

That gets rid of the annoying "Deploying..." text and some other useless output.

chrisneal avatar Jan 25 '22 16:01 chrisneal

Same thing when deploying with Github Actions

image

kcjonson avatar Mar 22 '22 01:03 kcjonson

@kcjonson Can you post your GitHub action file?

chrisneal avatar Mar 22 '22 08:03 chrisneal

I can do you one better, here's the source in a barebones standalone repo: https://github.com/kcjonson/serverless-nextjs

Github action file here: https://github.com/kcjonson/serverless-nextjs/blob/main/.github/workflows/deploy-preview.yml

kcjonson avatar Mar 22 '22 15:03 kcjonson

@kcjonson Thanks mate. It looks as though you’re still deploying using the ‘serverless’ command. Switch that out for the ‘npx …’ command I said above.

chrisneal avatar Mar 22 '22 17:03 chrisneal

This workaround works. Hopefully, this patch or similar makes it into the upstream serverless project. 🤞

mikeputnam avatar Apr 12 '22 16:04 mikeputnam

@mikeputnam perhaps we want to re-open this issue as it hasn't actually been resolved. Only a work-around has been suggested.

jamiechong avatar Jun 13 '22 17:06 jamiechong