polonskiy / crowdr

Crowdr is a tool for managing multiple Docker containers
MIT License
95 stars 9 forks source link

sourcing hooks + dry run feature #4

Closed coderofsalvation closed 9 years ago

coderofsalvation commented 9 years ago

I ran into a situation where crowdr became hard to use with >5 containers (takes docker a long time). Therefore, I needed to review the performed docker commands upfront, in other words a dry-run (like rsync's --dry-run).

CROWDR_DRY=1 crowdr run

This will show exactly which docker commands would be executed including the hooks, without actually executing them.

This feature made me realize the need of another feature: sourcing hooks instead of executing them in a seperate process. Now the hooks can use (env)variables from the crowdr script.

Luckily both features could be implemented by adding one extra line.

Cheers

polonskiy commented 9 years ago

I have replaced alias with variable - it feels more straightforward. I thought about passing variables to hooks. I see two ways of doing it: sourcing hooks and setting env (exporting). Sourcing is more flexible but messy, because you can change variables inside a hook. Exporting is stricter but less flexible. Also, we need to know which variables to pass to hooks. We need more use cases.

Anyway :shipit: Added in 0.7.0. Thanks!

polonskiy commented 9 years ago

Btw

I ran into a situation where crowdr became hard to use with >5 containers (takes docker a long time).

Did you figure it out?