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

Add $__task so available in @setup #254

Merged
merged 3 commits into from
Aug 17, 2022

Conversation

arwinvdv
Copy link
Contributor

@arwinvdv arwinvdv commented Aug 17, 2022

Add the variable $__taskName so you can get the current task/storyname in the @setup directive. Now you don't have to specify extra variables when creating multiple stories. Example:

When running envoy run deploy, that you can get deploy. And when you run envoy run deploy_backend you can get deploy_backend

@servers(['localhost' => '127.0.0.1'])

@setup
   $releaseDir = $baseDir . '/releases/'.date('YmdHis');

   if($__taskName === 'deploy_backend') {
      $releaseDir =  $baseDir . '/current';
   }

@endsetup

// Complete deploy, create new folder and check project, run composer, npm etc.
@story('deploy')
   git_clone
   commontask_1
   commontask_2
   ....
@endstory

// Only update backend, pull backend in current dir and restart application, migrations etc.
@story('deploy_backend')
   git_pull
   commontask_1
   commontask_2
   ...
@endstory

Fixes #253

@taylorotwell taylorotwell merged commit eb2029a into laravel:2.x Aug 17, 2022
@driesvints driesvints changed the title Add $__taskName so available in @setup Add $__task so available in @setup Aug 30, 2022
pgrenaud pushed a commit to eXolnet/envoy that referenced this pull request Jul 19, 2023
* Add $__taskName so available in @setup

* simplify

* wip

Co-authored-by: Arwin <arwin@ligon.nl>
Co-authored-by: Taylor Otwell <taylor@laravel.com>
(cherry picked from commit eb2029a)
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.

Access task/story name in @setup
2 participants