Comments (9)
@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.
I don't think this is possible but feel free to prove me wrong and provide a solution through a PR.
from envoy.
@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.
Looked into it again, seems a bit more complex than my current skill level..
from envoy.
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.
@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.
@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.
@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.
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)
- Access server host inside a task HOT 5
- @servers to docker container HOT 1
- Support Microsoft Teams notifications HOT 1
- Accessing the server array when using multiple servers HOT 2
- delete cached Envoy.blade files HOT 2
- Multiple host patterns HOT 1
- Can't get value of snake case variables HOT 4
- Deprecated: file_exists() HOT 1
- Completion hooks as commands on remote server HOT 2
- Pass bash variables/arrays to php (and vice versa) HOT 1
- Localhost shell HOT 4
- upload file access HOT 1
- Access task/story name in @setup HOT 1
- PHP 8.2 Deprecated HOT 1
- support for the HostKeyAlgorithms and PubkeyAcceptedKeyTypes options HOT 2
- Artisan commands execute from original folder despite CDing to new folder!
- Request for Multiple Envoy Blade Files Support HOT 1
- Local task error or exit do not stop the script execution HOT 3
- ERROR: ssh: Could not resolve hostname HOT 5
- Feature request: re-use SSH connections? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envoy.