lezeh
is a CLI tool to ease day-to-day engineering operations such as:
* Cherry pick database row and its relations
* Visualize graph representation of a database row relations
* Merging feature branch (by convention, specific using phabricator task number) into master,
this includes cleaning up (delete) the merged feature branch
* Merge and run deployment commands
Go to latest releases and download the binaries here
| Binary | OS |
| ------------------------------------ | ----- |
| lezeh-x86_64-unknown-linux-gnu.zip
| Linux |
| lezeh-x86_64-apple-darwin.zip
| macOS |
bash
cargo install lezeh
This requires rust
bash
make install
First create config file at ~/.lezeh
, we're using YAML format.
```yaml phab: apitoken: test125 pkcs12path: /path/to/pkcs12 host: 'yourphabricatorhost.com' pkcs12_password: abcdefg
ghub: api_token: test124
bitly: api_token: test123
dbbyname: testdb: host: localhost port: 5432 database: db_name username: .... password: ....
deployment: repositories: # This is a unique key that will be used as hashmap key # for the repo. - key: "repo-key" path: "repo-local-path" githubpath: "username/reponame" deploymentschemebykey: stg: name: "Deploy to stg" defaultpullrequesttitle: "Merge into stg" mergefrombranch: "master" mergeintobranch: "stg" prod: name: "Deploy to prod" defaultpullrequesttitle: "Merge into prod" mergefrombranch: "stg" mergeintobranch: "prod" ```
lezeh url shorten {longUrl}
Mostly tooling related with database operations. Only supports postgres as of now.
Imagine you have this 1 table row that you want to copy but you can't easily copy it because it has relations and you need to copy the parents and children recursively. This is where cherry-pick can be useful.
```bash lezeh db cherry-pick \ # Fetch from test_db, this one is based on the config --source-db=testdb \
# As of now only supports 1 value, but it will change in the future --values=123 \
# Table that the value will be fetched from --table=orders \
# [Optional] which column that contains the given values, defaults to id --column=id \
# [Optional] Db schema, defaults to public --schema=public \
# [Optional], defaults to insert-statement. If supplied Graphviz then it'll serialize # the graph representation that can be represented in a graphviz format # see https://graphviz.org/ for more details. # The output can be used on online graphviz visualizer: # * https://edotor.net # * https://dreampuf.github.io/GraphvizOnline --output-format=insert-statement|graphviz \
# [Optional]
# The option will be used if you choose pass --output-format=graphviz
.
# Set the table columns that will be displayed on each node in format
# '{table1}:{column1}|{column2}|{columnn},{tablen}:{columnn}'
# for example 'users:id|name|email, orders:|code'
# If not set it'll default to only show the row id
--graph-table-columns='{table1}:{column1}|{column2}|{columnn},{tablen}:{columnn}, {tablen}:{columnn}'
```
```bash
lezeh deployment merge-feature-branches {tasknumber} {tasknumber} {task_number} ...
#
lezeh deployment deploy {repokey} {schemekey} ```