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

Need a way to replace just dev to run other commands before ftl dev . #1179

Closed
wesbillman opened this issue Apr 4, 2024 · 3 comments · Fixed by #1208
Closed

Need a way to replace just dev to run other commands before ftl dev . #1179

wesbillman opened this issue Apr 4, 2024 · 3 comments · Fixed by #1208
Labels
next Work that will be be picked up next

Comments

@wesbillman
Copy link
Collaborator

Currently, is some of the customer's repo we use just run commands before ftl dev ..

For example that just command might look something like this just dev:

# Start the FTL backend in "dev mode".
dev:
  # Restart when any migrations change.
  watchexec -r -f '**/migrations/*.sql' 'just db-migrate-all && ftl dev backend/modules --recreate'

This will run db migrations before starting ftl dev and rerun both if anything changes.

@github-actions github-actions bot added the triage Issue needs triaging label Apr 4, 2024
@alecthomas alecthomas mentioned this issue Apr 4, 2024
@alecthomas
Copy link
Collaborator

alecthomas commented Apr 4, 2024

My initial thoughts are that these should go in ftl-project.toml rather than ftl.toml, but I'm not 100% sure. We could start with something super simple though, that just executes commands before building.

@alecthomas alecthomas added next Work that will be be picked up next and removed triage Issue needs triaging labels Apr 9, 2024
@matt2e
Copy link
Collaborator

matt2e commented Apr 9, 2024

@wesbillman with your example, i wonder if we end up with this issue:

  • someone runs dev with some args
  • the config says to do something like you mention above that watches and then kicks off dev again
  • At some point the person is wondering why dev isnt running with the args they inputed (the pre-run script restarted dev with different args)

@wesbillman
Copy link
Collaborator Author

Oh yeah! My example might be bad since I just copy pasted, but I agree that having a watchexec type command in the rebuild would be pretty wild to debug.

I think a more common case might be something like

[commands]
pre-build = "just db-migrate-all"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next Work that will be be picked up next
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants