-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(binary options): fix an issue introduced by #141 and force lf
- Loading branch information
1 parent
2a8142c
commit 76c7bf2
Showing
37 changed files
with
3,097 additions
and
3,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
/.pytest_cache/ | ||
/.eggs/ | ||
/.coverage | ||
/.python-version | ||
/.tox/ | ||
*.egg-info | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
./.idea | ||
.idea | ||
/dist/ | ||
/build/ | ||
/site/ | ||
/.pytest_cache/ | ||
/.eggs/ | ||
/.coverage | ||
/.python-version | ||
/.tox/ | ||
*.egg-info | ||
__pycache__/ | ||
*.pyc | ||
*.pyo | ||
./.idea | ||
.idea | ||
/dist/ | ||
/build/ | ||
/site/ | ||
/out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
doc-watch: | ||
docker run --rm -it -p 8000:8000 --user $(id -u):$(id -g) -v ${PWD}:/docs squidfunk/mkdocs-material serve | ||
|
||
doc-publish: | ||
docker run --rm -it -p 8000:8000 --user $(id -u):$(id -g) -v ${PWD}/..:/docs -v ${HOME}/.netrc:/.netrc:ro --workdir=/docs/ddb squidfunk/mkdocs-material gh-deploy | ||
|
||
git-pre-push: | ||
make style | ||
make test | ||
|
||
style: | ||
pylint ddb | ||
|
||
test: | ||
pytest | ||
|
||
check-manifest: | ||
doc-watch: | ||
docker run --rm -it -p 8000:8000 --user $(id -u):$(id -g) -v ${PWD}:/docs squidfunk/mkdocs-material serve | ||
|
||
doc-publish: | ||
docker run --rm -it -p 8000:8000 --user $(id -u):$(id -g) -v ${PWD}/..:/docs -v ${HOME}/.netrc:/.netrc:ro --workdir=/docs/ddb squidfunk/mkdocs-material gh-deploy | ||
|
||
git-pre-push: | ||
make style | ||
make test | ||
|
||
style: | ||
pylint ddb | ||
|
||
test: | ||
pytest | ||
|
||
check-manifest: | ||
check-manifest -u -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
ddb | ||
=== | ||
|
||
[![PyPI](https://img.shields.io/pypi/v/docker-devbox-ddb)](https://pypi.org/project/docker-devbox-ddb/) | ||
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/docker-devbox-ddb)](https://pypi.org/project/docker-devbox-ddb/) | ||
[![PyPI - License](https://img.shields.io/pypi/l/docker-devbox-ddb)](https://github.com/gfi-centre-ouest/docker-devbox-ddb/blob/develop/LICENSE) | ||
[![Build Status](https://github.com/gfi-centre-ouest/docker-devbox-ddb/workflows/build/badge.svg)](https://github.com/gfi-centre-ouest/docker-devbox-ddb/actions?query=workflow%3Abuild) | ||
[![Code coverage](https://img.shields.io/coveralls/github/gfi-centre-ouest/docker-devbox-ddb)](https://coveralls.io/github/gfi-centre-ouest/docker-devbox-ddb) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/relekang/python-semantic-release) | ||
|
||
**[Erase environment differences, make developers happy !](https://gfi-centre-ouest.github.io/docker-devbox-ddb)** | ||
|
||
**ddb** automates application configuration so differences between development, staging and production environment can | ||
be erased. It provides features to generate, activate and adjust configuration files based on a single overridable and | ||
extendable configuration, while enhancing the developer experience and reducing manual operations. | ||
|
||
Primarly designed for [docker-compose](https://docs.docker.com/compose/) and [docker-devbox](https://github.com/gfi-centre-ouest/docker-devbox), | ||
this tool makes the developer forget about the docker hard stuff by providing commands right into it's PATH, so it's | ||
experience looks like everything is native and locally installed. | ||
|
||
Thanks to a pluggable, event based and easy to extend architecture, it can bring powerful configuration automation to | ||
any technical context. | ||
|
||
Install | ||
------- | ||
|
||
**ddb** is supported on Linux and Windows. MacOS is still unsupported, but it should come soon. | ||
|
||
You can [download binary releases on github](https://github.com/gfi-centre-ouest/docker-devbox-ddb/releases), or | ||
install on Python >= 3.5 with pip. | ||
|
||
``` | ||
pip install docker-devbox-ddb | ||
``` | ||
|
||
Docs | ||
---- | ||
|
||
[Documentation is available here](https://gfi-centre-ouest.github.io/docker-devbox-ddb) | ||
ddb | ||
=== | ||
|
||
[![PyPI](https://img.shields.io/pypi/v/docker-devbox-ddb)](https://pypi.org/project/docker-devbox-ddb/) | ||
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/docker-devbox-ddb)](https://pypi.org/project/docker-devbox-ddb/) | ||
[![PyPI - License](https://img.shields.io/pypi/l/docker-devbox-ddb)](https://github.com/gfi-centre-ouest/docker-devbox-ddb/blob/develop/LICENSE) | ||
[![Build Status](https://github.com/gfi-centre-ouest/docker-devbox-ddb/workflows/build/badge.svg)](https://github.com/gfi-centre-ouest/docker-devbox-ddb/actions?query=workflow%3Abuild) | ||
[![Code coverage](https://img.shields.io/coveralls/github/gfi-centre-ouest/docker-devbox-ddb)](https://coveralls.io/github/gfi-centre-ouest/docker-devbox-ddb) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/relekang/python-semantic-release) | ||
|
||
**[Erase environment differences, make developers happy !](https://gfi-centre-ouest.github.io/docker-devbox-ddb)** | ||
|
||
**ddb** automates application configuration so differences between development, staging and production environment can | ||
be erased. It provides features to generate, activate and adjust configuration files based on a single overridable and | ||
extendable configuration, while enhancing the developer experience and reducing manual operations. | ||
|
||
Primarly designed for [docker-compose](https://docs.docker.com/compose/) and [docker-devbox](https://github.com/gfi-centre-ouest/docker-devbox), | ||
this tool makes the developer forget about the docker hard stuff by providing commands right into it's PATH, so it's | ||
experience looks like everything is native and locally installed. | ||
|
||
Thanks to a pluggable, event based and easy to extend architecture, it can bring powerful configuration automation to | ||
any technical context. | ||
|
||
Install | ||
------- | ||
|
||
**ddb** is supported on Linux and Windows. MacOS is still unsupported, but it should come soon. | ||
|
||
You can [download binary releases on github](https://github.com/gfi-centre-ouest/docker-devbox-ddb/releases), or | ||
install on Python >= 3.5 with pip. | ||
|
||
``` | ||
pip install docker-devbox-ddb | ||
``` | ||
|
||
Docs | ||
---- | ||
|
||
[Documentation is available here](https://gfi-centre-ouest.github.io/docker-devbox-ddb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,103 @@ | ||
# -*- coding: utf-8 -*- | ||
from abc import abstractmethod, ABC | ||
from typing import Iterable, Tuple | ||
|
||
from ddb.registry import RegistryObject | ||
|
||
|
||
class Binary(RegistryObject, ABC): | ||
""" | ||
Wraps a binary on the system. | ||
""" | ||
|
||
@property | ||
@abstractmethod | ||
def name(self) -> str: | ||
""" | ||
Name of the binary. | ||
""" | ||
|
||
@abstractmethod | ||
def command(self, *args) -> Iterable[str]: | ||
""" | ||
Get the binary command. | ||
""" | ||
|
||
@abstractmethod | ||
def should_run(self, *args) -> bool: | ||
""" | ||
Check if this binary should run. | ||
""" | ||
|
||
@abstractmethod | ||
def priority(self) -> int: | ||
""" | ||
Priority of this binary amoung binaries with the same name that should run. | ||
""" | ||
|
||
@abstractmethod | ||
def before_run(self, *args) -> None: | ||
""" | ||
Add action to be executed before running the command. | ||
""" | ||
|
||
@abstractmethod | ||
def __eq__(self, other) -> bool: | ||
pass | ||
|
||
@abstractmethod | ||
def __hash__(self): | ||
pass | ||
|
||
|
||
class AbstractBinary(Binary, ABC): | ||
""" | ||
Abstract implementation for binary. | ||
""" | ||
|
||
def __init__(self, name: str): | ||
self._name = name | ||
|
||
@property | ||
def name(self) -> str: | ||
return self._name | ||
|
||
def before_run(self, *args) -> None: | ||
return None | ||
|
||
def should_run(self, *args) -> bool: | ||
return True | ||
|
||
def priority(self) -> int: | ||
return 0 | ||
|
||
def __eq__(self, other) -> bool: | ||
if not isinstance(other, AbstractBinary): | ||
return False | ||
return self.name == other.name | ||
|
||
def __hash__(self): | ||
return hash((self.name,)) | ||
|
||
|
||
class DefaultBinary(AbstractBinary): | ||
""" | ||
Default implementation for binary. | ||
""" | ||
|
||
def __init__(self, name: str, command: Iterable[str]): | ||
super().__init__(name) | ||
self._command = tuple(command) | ||
|
||
def command(self, *args) -> Tuple[str]: | ||
return self._command | ||
|
||
def __eq__(self, other) -> bool: | ||
if not super().__eq__(other): | ||
return False | ||
if not isinstance(other, DefaultBinary): | ||
return False | ||
return self.command() == other.command() | ||
|
||
def __hash__(self): | ||
return hash((super().__hash__(), self.command())) | ||
# -*- coding: utf-8 -*- | ||
from abc import abstractmethod, ABC | ||
from typing import Iterable, Tuple | ||
|
||
from ddb.registry import RegistryObject | ||
|
||
|
||
class Binary(RegistryObject, ABC): | ||
""" | ||
Wraps a binary on the system. | ||
""" | ||
|
||
@property | ||
@abstractmethod | ||
def name(self) -> str: | ||
""" | ||
Name of the binary. | ||
""" | ||
|
||
@abstractmethod | ||
def command(self, *args) -> Iterable[str]: | ||
""" | ||
Get the binary command. | ||
""" | ||
|
||
@abstractmethod | ||
def should_run(self, *args) -> bool: | ||
""" | ||
Check if this binary should run. | ||
""" | ||
|
||
@abstractmethod | ||
def priority(self) -> int: | ||
""" | ||
Priority of this binary amoung binaries with the same name that should run. | ||
""" | ||
|
||
@abstractmethod | ||
def before_run(self, *args) -> None: | ||
""" | ||
Add action to be executed before running the command. | ||
""" | ||
|
||
@abstractmethod | ||
def __eq__(self, other) -> bool: | ||
pass | ||
|
||
@abstractmethod | ||
def __hash__(self): | ||
pass | ||
|
||
|
||
class AbstractBinary(Binary, ABC): | ||
""" | ||
Abstract implementation for binary. | ||
""" | ||
|
||
def __init__(self, name: str): | ||
self._name = name | ||
|
||
@property | ||
def name(self) -> str: | ||
return self._name | ||
|
||
def before_run(self, *args) -> None: | ||
return None | ||
|
||
def should_run(self, *args) -> bool: | ||
return True | ||
|
||
def priority(self) -> int: | ||
return 0 | ||
|
||
def __eq__(self, other) -> bool: | ||
if not isinstance(other, AbstractBinary): | ||
return False | ||
return self.name == other.name | ||
|
||
def __hash__(self): | ||
return hash((self.name,)) | ||
|
||
|
||
class DefaultBinary(AbstractBinary): | ||
""" | ||
Default implementation for binary. | ||
""" | ||
|
||
def __init__(self, name: str, command: Iterable[str]): | ||
super().__init__(name) | ||
self._command = tuple(command) | ||
|
||
def command(self, *args) -> Tuple[str]: | ||
return self._command | ||
|
||
def __eq__(self, other) -> bool: | ||
if not super().__eq__(other): | ||
return False | ||
if not isinstance(other, DefaultBinary): | ||
return False | ||
return self.command() == other.command() | ||
|
||
def __hash__(self): | ||
return hash((super().__hash__(), self.command())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.