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 "hooks" in build tasks #136

Closed
michaelsauter opened this issue Aug 10, 2021 · 3 comments · Fixed by #214
Closed

Support "hooks" in build tasks #136

michaelsauter opened this issue Aug 10, 2021 · 3 comments · Fixed by #214
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@michaelsauter
Copy link
Member

Currently there is no control over what gets executed in builder tasks (such as ods-build-go). While this is by design (to prevent customisations that are not predictable) it is probably too restrictive. For example, given we have a solution for #135, users might want to run database migrations before running the integration test suite. With the current design, this would not be possible with the official task and a custom task would be needed.

One option could be to provide more parameters that allow to run scripts before/after certain steps in the task, such as before running tests (e.g. params.script-before-tests) and after running tests (e.g. params.script-after-tests). While this would allow users to run arbitrary things in the task, it would not allow them to bypass the default behaviour without doing crazy stuff.

Thoughts?

FYI @felipecruz91 @renedupont

@michaelsauter michaelsauter added the question Further information is requested label Aug 10, 2021
@michaelsauter michaelsauter changed the title Support "hooks" Support "hooks"? Aug 10, 2021
@felipecruz91
Copy link
Contributor

That could be a good starting point. I assume it will be quite simple at the beginning, by just running an entrypoint bash script, e.g. script-before-tests.sh and script-after-tests.sh where users would put their logic in there, right?

@michaelsauter
Copy link
Member Author

Correct. If we wanted to, we could even auto-detect such scripts instead of having many parameters. Not sure which option is better ... the params at least would provide clear documentation.

@felipecruz91
Copy link
Contributor

I'd rather have them explicitly via parameters

@michaelsauter michaelsauter added this to the 0.2.0 milestone Aug 10, 2021
@michaelsauter michaelsauter modified the milestones: 0.2.0, 0.1.0 Sep 16, 2021
@michaelsauter michaelsauter self-assigned this Sep 16, 2021
michaelsauter added a commit that referenced this issue Sep 16, 2021
Closes #136.

I assume we do not need this for NPM and Gradle, because those allow to
customize what is executed as a test (e.g. by adding a dependency to the
`test` task in `build.gradle`).
michaelsauter added a commit that referenced this issue Sep 16, 2021
Closes #136.

I assume we do not need this for NPM and Gradle, because those allow to
customize what is executed as a test (e.g. by adding a dependency to the
`test` task in `build.gradle`).
@michaelsauter michaelsauter added enhancement New feature or request and removed question Further information is requested labels Sep 16, 2021
@michaelsauter michaelsauter changed the title Support "hooks"? Support "hooks" in build tasks Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants