Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
a1fred committed Nov 25, 2021
1 parent 672698a commit c036d9d
Showing 1 changed file with 0 additions and 58 deletions.
58 changes: 0 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,68 +23,10 @@ $ pip3 install carnival_contrib # Optional community receipts
## Docs
Documentation available at [readthedocs.org](https://carnival.readthedocs.io/ru/latest/)

## Cli
### Usage
```bash
$ carnival --help
Usage: carnival [OPTIONS] [deploy_frontend|deploy_backend]...

Options:
-d, --dry_run Simulate run
--debug Turn on debug mode
--help Show this message and exit.
```

### Competion
* for *Bash*: place `eval "$(_CARNIVAL_COMPLETE=bash_source carnival)"` in .bashrc
* for *ZSH*: place `eval "$(_CARNIVAL_COMPLETE=zsh_source carnival)"` in .zshrc

## Quick example
`carnival_file.py` - entry point for carnival cli

Lets create one.
```python
from carnival import Step, Host, Task, cmd

class Deploy(Task):
def run(self):
self.step(
[DeployFrontend(), ],
[Host("1.2.3.5", ssh_user="root", can="context", additional="give"), ],
)

self.step(
[DeployFrontend(), ],
[
Host("root@1.2.3.6", can="give", additional="context"),
Host("root@1.2.3.7", can="context", additional="give"),
]
)


class DeployFrontend(Step):
def run(self, can, additional, **kwargs):
cmd.apt.install_multiple("htop", "nginx")
cmd.systemd.enable("nginx", start_now=True)


class DeployBackend(Step):
def run(self, can, additional, **kwargs):
cmd.apt.install_multiple("htop")
cmd.docker.install_ce_ubuntu()
cmd.docker.install_compose()
```

Run
```
$ python3 -m carnival deploy
💃💃💃 Runing ⛏frontend at 🖥 1.2.3.4
...
💃💃💃 Runing ⛏frontend at 🖥 1.2.3.5
...
```


## Develop
### Run tests
```bash
Expand Down

0 comments on commit c036d9d

Please sign in to comment.