Skip to content

feat: Allow tasks to run in two stages, "before" or "after" copy #2050

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bhuynhdev
Copy link

What

This PR looks to resolve #240 by allowing tasks to run in two stages, "before" or "after" copy, similar to how #1510 implemented pre-copy and post-copy migration tasks

How

  • Make Template.tasks function accept an additional argument stage
    • Pass this stage via extra_vars so that the rendering context knows which _stage we're in
    • Default tasks' condition to {{ _stage == 'after' }} so that the default behavior is post-copy tasks
  • In main.py: Change run_copy to execute tasks twice, before and after _render_template

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.

Allow finer control over execution of tasks
1 participant