-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added new command startproject * Updated docs * Update README.md
- Loading branch information
Showing
13 changed files
with
206 additions
and
20 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
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Commnand line | ||
|
||
PyMS has some command to make easy your developments: | ||
|
||
```bash | ||
pyms -h | ||
``` | ||
Show you a list of options and help instructions to use this command like: | ||
|
||
```bash | ||
usage: main.py [-h] [-v VERBOSE] {encrypt,create-key,startproject} ... | ||
|
||
Python Microservices | ||
|
||
optional arguments: | ||
-h, --help show this help message and exit | ||
-v VERBOSE, --verbose VERBOSE | ||
Verbose | ||
|
||
Commands: | ||
Available commands | ||
|
||
{encrypt,create-key,startproject} | ||
encrypt Encrypt a string | ||
create-key Generate a Key to encrypt strings in config | ||
startproject Generate a project from https://github.com/python- | ||
microservices/microservices-template | ||
|
||
``` | ||
|
||
## Start a project | ||
|
||
Command: | ||
```bash | ||
pyms startproject | ||
``` | ||
|
||
This command create a project template like [Microservices Scaffold](https://github.com/python-microservices/microservices-scaffold). | ||
This command use [cookiecutter](https://github.com/cookiecutter/cookiecutter) to download and install this [template](https://github.com/python-microservices/microservices-template) | ||
|
||
!!! warning | ||
You must run first `pip install cookiecutter==1.7.0` | ||
|
||
## Create a key encrypt/decrypt file | ||
|
||
Command: | ||
```bash | ||
pyms create-key | ||
``` | ||
|
||
Create a key file to encrypt strings in your configuration file. This key is created with [AES](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard). | ||
You can run the next command in the terminal. See [Encrypt/Decrypt Configuration](encrypt_decryt_configuration.md) | ||
for more information | ||
|
||
## Encrypt a string | ||
|
||
Command: | ||
```bash | ||
pyms encrypt [string] | ||
``` | ||
|
||
Encrypt a string to use in your [configfile](configuration.md) | ||
|
||
```bash | ||
pyms encrypt 'mysql+mysqlconnector://important_user:****@localhost/my_schema' | ||
>> Encrypted OK: b'gAAAAABeSwBJv43hnGAWZOY50QjBX6uGLxUb3Q6fcUhMxKspIVIco8qwwZvxRg930uRlsd47isroXzkdRRnb4-x2dsQMp0dln8Pm2ySHH7TryLbQYEFbSh8RQK7zor-hX6gB-JY3uQD3IMtiVKx9AF95D6U4ydT-OA==' | ||
``` | ||
|
||
See [Encrypt/Decrypt Configuration](encrypt_decryt_configuration.md) for more information |
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
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
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
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,3 +1,3 @@ | ||
from pyms.cmd.main import Command | ||
from .main import Command | ||
|
||
__all__ = ['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
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,4 +1,4 @@ | ||
from pyms.config.conf import get_conf | ||
from pyms.config.confile import ConfFile | ||
from .conf import get_conf | ||
from .confile import ConfFile | ||
|
||
__all__ = ['get_conf', 'ConfFile'] |
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,5 +1,5 @@ | ||
from pyms.flask.app.create_app import Microservice | ||
from pyms.flask.app.create_config import config | ||
from .create_app import Microservice | ||
from .create_config import config | ||
|
||
|
||
__all__ = ['Microservice', 'config'] |
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,4 +1,4 @@ | ||
from pyms.flask.healthcheck.healthcheck import healthcheck_blueprint | ||
from .healthcheck import healthcheck_blueprint | ||
|
||
|
||
__all__ = ['healthcheck_blueprint'] |
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,5 +1,5 @@ | ||
"""Init file | ||
""" | ||
from pyms.logger.logger import CustomJsonFormatter | ||
from .logger import CustomJsonFormatter | ||
|
||
__all__ = ['CustomJsonFormatter', ] |
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,3 +1,3 @@ | ||
from pyms.utils.utils import import_from, import_package, check_package_exists | ||
from .utils import import_from, import_package, check_package_exists | ||
|
||
__all__ = ['import_from', 'import_package', 'check_package_exists'] |
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