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

feat: add start option to post build #151

Merged

Conversation

alexjfno1
Copy link
Contributor

@alexjfno1 alexjfno1 commented Mar 10, 2021

Fixes #146

Added

This PR adds the ability to specify a custom start command, wait-on & wait-on-timeout in the postBuild stage of the build. It mimics the behaviour of the options in the preBuild stage.

Example:

[plugins.inputs.postBuild]
    enable = true
    start = 'npx serve public'
    wait-on = 'http://localhost:5000'
    wait-on-timeout = '30' # seconds

It also contains refactoring of the index.js file to break it into smaller files as I felt it was getting too large. Jest has also been added for unit testing of these files.

Tasks

  • Add the ability to specify a start option in inputs.postBuild which will run the command instead of serving the public folder. If no start command is specified the original behavior still exists.
  • Add Jest to unit test functionality. This can be run with npm run test:unit.
  • Added unit tests for onPostBuild.
  • Add CircleCI test job
  • Refactor index.js into smaller files.
  • Update README

@CLAassistant
Copy link

CLAassistant commented Mar 10, 2021

CLA assistant check
All committers have signed the CLA.

@alexjfno1 alexjfno1 force-pushed the post-build-start-command branch 2 times, most recently from 537e58d to 09f17a3 Compare March 10, 2021 12:22
@alexjfno1
Copy link
Contributor Author

alexjfno1 commented Mar 10, 2021

Hi @bahmutov,

This is a PR to solve #146, there are still a few things I need to do but what are your thoughts on this?

@alexjfno1 alexjfno1 marked this pull request as ready for review March 10, 2021 16:12
@alexjfno1
Copy link
Contributor Author

@bahmutov do I need to configure something to get the build on CircleCI to work correctly?

image

@bahmutov
Copy link
Contributor

It is pretty annoying, since it requires to use Netlify during tests, thus it needs private token, ughh. Let me merge your PR into my branch then all the tests will run and we will see.

@bahmutov bahmutov changed the base branch from master to add-post-build-start March 29, 2021 15:23
@bahmutov bahmutov changed the title Add start option to post build feat: add start option to post build Mar 29, 2021
@bahmutov bahmutov merged commit cbb8870 into cypress-io:add-post-build-start Mar 29, 2021
bahmutov added a commit that referenced this pull request Mar 29, 2021
Co-authored-by: Alex Foster <alexjfno1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serve build output using Netlify CLI in postBuild stage
3 participants