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

Feature request: simulate / dry-run option #1488

Closed
skarnl opened this issue Jan 3, 2018 · 7 comments
Closed

Feature request: simulate / dry-run option #1488

skarnl opened this issue Jan 3, 2018 · 7 comments

Comments

@skarnl
Copy link
Contributor

skarnl commented Jan 3, 2018

It would be nice to be able to dry-run a deploy when setting up the different tasks.
Especially to see the different sub-tasks that are run. I now have to look up the order of the deploy-tasks in the documentation.
And also when setting up the deploy configuration, I actually have to run it with -vvv to see the different commands that are executed.
It would be nice to just see the output written to the screen when you have the option --dry-run added or --simulate or something

I understand that would mean all the recepices or core functions need to be aware of this.
But I think it would help tremendously when debugging / setting up a deploy.
And I would be happy to help with getting this done.

@antonmedv
Copy link
Member

This is a good think but a little bit tricky. What to return from test for example?

if (test('...')) {
    run('a');
} else {
    run('b');
}

@skarnl
Copy link
Contributor Author

skarnl commented Jan 3, 2018

I see your point.

Theoretically you would like to see what would be run, based on if the test succeeded or not.

So in case of:

if (test(true)) {
   run('a');
} else {
   run('b');
}

it would be awesome to see something like:

# test = true
# run('a')

and for

if (test(false)) {
   run('a');
} else {
   run('b');
}

you would see:

# test = false
# run('a')

But I don't know if this is easily implemented 🙄

@skarnl
Copy link
Contributor Author

skarnl commented Jan 3, 2018

I think the thing we miss the most is an option to dump/print the order of executing of the tasks.
For the actual executing you can use the --log option ... but something so you don't have to dive into a recipe/*.php to see the order of the deploy-task and check for tasks that are added with before and after

So when we do something like dep debug:task deploy (or something like that) we would get something like:

$ dep debug:task deploy

    deploy:
      'deploy:info',
      'custom:task', //added with before
      'deploy:prepare',
      'deploy:lock',
      'deploy:release',
      'deploy:update_code',
      'deploy:copy_dirs', //added with after
      'deploy:shared',
      'deploy:vendors',
      'deploy:writable',
      'artisan:storage:link',
      'artisan:view:clear',
      'artisan:cache:clear',
      'artisan:config:cache',
      'artisan:optimize',
      'deploy:symlink',
      'deploy:unlock',
      'custom_other_task',
      'cleanup',
      'some_other_custom_task' //added with after

So we have one flow-overview of all the different tasks and the order in which they will be executed

@staabm
Copy link
Contributor

staabm commented Jan 3, 2018

are you aware of the -vvv argument (debug mode)?

@skarnl
Copy link
Contributor Author

skarnl commented Jan 3, 2018

Yes, but that actually does the deploy. And I want to be able to see/debug my deploy without actually performing the deploy.
I'm just starting setting up my projects with Deployer and I notice I need to execute dep deploy testing to actually see if an task will be triggered before/after another task.
And I now use the recipe/laravel.php file to see what tasks will be called and in what order.

And imo this should be debuggable / viewable using the CLI ^^

@skarnl
Copy link
Contributor Author

skarnl commented Jan 3, 2018

Ok, I'm almost finished with a DebugCommand ^^
Will add a PR later today 😊

@antonmedv
Copy link
Member

This is kinda done in master! Checkout --plan option!

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

No branches or pull requests

3 participants