Skip to content

Commit

Permalink
add oop i did it again
Browse files Browse the repository at this point in the history
  • Loading branch information
goFrendiAsgard committed Nov 4, 2023
1 parent b232271 commit d0842db
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![](https://raw.githubusercontent.com/state-alchemists/zrb/main/images/zrb/android-chrome-192x192.png)

[📖 Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md) | [🏁 Getting started](https://github.com/state-alchemists/zrb/blob/main/docs/getting-started.md) | [❓ FAQ](https://github.com/state-alchemists/zrb/blob/main/docs/faq/README.md)
[📖 Documentation](https://github.com/state-alchemists/zrb/blob/main/docs/README.md) | [🏁 Getting Started](https://github.com/state-alchemists/zrb/blob/main/docs/getting-started.md) | [💃 Oops, I did it Again](https://github.com/state-alchemists/zrb/blob/main/docs/oops-i-did-it-again/README.md)| [❓ FAQ](https://github.com/state-alchemists/zrb/blob/main/docs/faq/README.md)

Zrb is a [CLI-based](https://en.wikipedia.org/wiki/Command-line_interface) automation [tool](https://en.wikipedia.org/wiki/Programming_tool) and [low-code](https://en.wikipedia.org/wiki/Low-code_development_platform) platform. Once installed, Zrb will help you automate day-to-day tasks, generate projects and applications, and even deploy your applications to Kubernetes with a few commands.

Expand Down
5 changes: 3 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [Configurations](configurations.md)
- [Tutorials](tutorials/README.md)
- [Troubleshooting](troubleshooting/README.md)
- [For contributors](for-contributors.md)
- [For maintainers](for-maintainers.md)
- [Oops, I Did it Again: Most Common Mistakes When Working with Zrb](oops-i-did-it-again/README.md)
- [Contributor Guide](contributor-guide.md)
- [Maintainer Guide](maintainer-guide.md)
- [FAQ](faq/README.md)
2 changes: 1 addition & 1 deletion docs/for-contributors.md → docs/contributor-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🔖 [Table of Contents](README.md)

# For contributors
# Contributor Guide


As contributors, there are some things you can do:
Expand Down
2 changes: 1 addition & 1 deletion docs/for-maintainers.md → docs/maintainer-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🔖 [Table of Contents](README.md)

# For maintainers
# Maintainer Guide


To publish Zrb, you need a `Pypi` account:
Expand Down
3 changes: 3 additions & 0 deletions docs/oops-i-did-it-again/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Oops, I did it again: Most Common Mistakes When Working with Zrb

Collection of
8 changes: 8 additions & 0 deletions src/zrb/task/docker_compose_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ def __init__(
self._compose_runtime_file = self._get_compose_runtime_file(
self._compose_template_file
)
# Flag to make mark whether service config and compose environments
# has been added to this task's envs and env_files
self._is_additional_env_added = False

def copy(self) -> TDockerComposeTask:
Expand All @@ -164,6 +166,12 @@ async def run(self, *args, **kwargs: Any) -> CmdResult:
return result

def _get_all_envs(self) -> Mapping[str, Env]:
'''
This method override BaseTask's _get_all_envs.
Whenever _get_all_envs is called, we want to make sure that:
- Service config's envs and env_files are included
- Any environment defined in docker compose file is also included
'''
if self._is_additional_env_added:
return super()._get_all_envs()
self._is_additional_env_added = True
Expand Down

0 comments on commit d0842db

Please sign in to comment.