flightplan icon indicating copy to clipboard operation
flightplan copied to clipboard

support for transport.fly

Open basz opened this issue 10 years ago • 7 comments

Is there a -native- way to run sub-tasks, something similar of

transport.exec('fly build-phar:prod');

The above works, but ANSI colors are lost and we get nested output.

localhost ● ok
# transport.exec starts here
localhost $ fly build-phar:prod
localhost > ✈ Running build-phar:prod
localhost > ✈ Flight to localhost started
localhost > localhost $ echo Compiling Phar executable 
localhost > localhost > Compiling Phar executable
localhost > localhost ● ok
localhost > ✈ Flight to localhost finished after 18 ms
localhost > ✈ Flightplan finished after 19 ms
localhost ● ok

ps. Apologies if this is not the place for support. Where should I ask these questions?

basz avatar Jan 26 '15 15:01 basz

You could try to execute plan.run(task, target, options), fly does the same.

Please note that I never tried this, but I understand the use case, so please let me know if this works out for you.

pstadler avatar Jan 26 '15 15:01 pstadler

Another idea is to write your tasks like this:

plan.local(['build-phar', 'deploy'], ...);
plan.local(['deploy'], ...);

When you now run fly deploy, the build-phar task is executed as well.

pstadler avatar Jan 26 '15 16:01 pstadler

Had a long chat with @pstadler many centuries ago on a similar issue but now I cannot find it. I wanted to be able to do two things: (1) compose tasks using other tasks, (2) be able to say: fly task1,task2,task3:destination .......

After various stops and starts, I have a framework built on top of Flightplan to obtain the above. Not entirely sure that this is the right way to go about it.

ravi avatar Jan 26 '15 16:01 ravi

plan.run(task, target, options) does work indeed. however the current task isn't halted. can't rely on its result therefore.

i'v opted for exec('fly ...'), for now. thx

basz avatar Jan 26 '15 20:01 basz

@basz thanks for reporting back. @ravi see #45. I wouldn't call this a discussion, as you didn't explain me that the current implementation is not enough for your needs.

So there are two use cases:

  1. Running multiple tasks from command line (e.g. fly task1,task2:target) This could be done and makes sense somehow. Also the refactoring from 0.4.x to 0.5.x definitely makes this way easier to implement.

  2. Running a task from a running task Not sure about this one.

pstadler avatar Jan 26 '15 21:01 pstadler

@pstadler fair enough, I didn't want to get too deep into the matter on #45 (thanks for finding that) because I figured the need may be specific to me.

ravi avatar Jan 26 '15 22:01 ravi

Let me add case 3: task1 has a dependency on task2, flightplan needs to provide a way to define this relationship.

oliverzy avatar Feb 03 '15 09:02 oliverzy