Coder Social home page Coder Social logo

Feature Request: Manageable Envoy code: Add ability for a story to call another story, or to pass variables into tasks about envoy HOT 9 CLOSED

laravel avatar laravel commented on April 27, 2024
Feature Request: Manageable Envoy code: Add ability for a story to call another story, or to pass variables into tasks

from envoy.

Comments (9)

driesvints avatar driesvints commented on April 27, 2024 2
@story('s1')
    _task_s1
    common
@endstory

@story('s2')
    _task_s2
    common
@endstory

@task('_task_s1')
    file=".env_local"
@endtask

@task('_task_s2')
    file=".env_prod"
@endtask

@task('common')
    echo "file: {{ $file }}";
    #rm -rf {{ $file }}
@endtask

I don't understand here why you can't do this with the current functionality:

@task('common')
    echo "file: {{ $file }}";
    #rm -rf {{ $file }}
@endtask
envoy run common --file=".env_local"

Like I said: I'll need a very concrete example in order to know what it is that you're trying to achieve.

from envoy.

driesvints avatar driesvints commented on April 27, 2024

I don't think this is possible but feel free to prove me wrong and provide a solution through a PR.

from envoy.

connecteev avatar connecteev commented on April 27, 2024

@driesvints I believe everything is possible, the question is, is it feasible, and should we do it?Based on my very limited knowledge of the envoy source code, it may not be easy to call a story within another one (or a task within another one) given that the tasks are stored in an array.

However, isn't passing variables into Envoy @ tasks a possibility and also something that makes sense? I've never made changes to a low-level library package, let me know if you'd be open to a PR still..and of course, pointers are appreciated.

from envoy.

connecteev avatar connecteev commented on April 27, 2024

Looked into it again, seems a bit more complex than my current skill level..

from envoy.

driesvints avatar driesvints commented on April 27, 2024

I believe everything is possible

I'm sorry but I really don't think it is. You're working with CLI commands here, not PHP code. The blade control structures only allow you to organise the scripts. Maybe we can find a way to re-use parts.

I don't have the time to look into this at the moment so feel free to send in a PR if you have time.

from envoy.

connecteev avatar connecteev commented on April 27, 2024

@driesvints I guess I'll have to stick with code duplication for now..not ideal but also not the end of the world.

from envoy.

driesvints avatar driesvints commented on April 27, 2024

@connecteev I've tried to deep-dive into this but atm I really don't see a use case for this. If you could give me more info and especially some very concrete examples on what it is that you're trying to do then I'd be happy to look into this further.

Feel free to reply.

from envoy.

connecteev avatar connecteev commented on April 27, 2024

@driesvints the use-case is basically keeping the code DRY so that I am not replicating a ton of the same code across stories and tasks in my Envoy script. Right now, I have no choice but to do that.

from envoy.

connecteev avatar connecteev commented on April 27, 2024

That's what I mean by 'making it more manageable' or modular. More details in the description and #142. Let me know if anything is unclear about the use-case.

from envoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.