feat: simplify work with Database Lab CLI (port forwarding) (platform#91)
Description
Simplify work with Database Lab CLI (port forwarding)
Related issue
platform#91
Examples
Command line:
$ dblab port-forward
2020/06/17 17:48:40 [INFO] The connection is available by address: 127.0.0.1:3000
$ dblab clone port-forward CLONE_ID
2020/06/17 17:54:27 [INFO] The clone is available by address: 127.0.0.1:3000
$ dblab --forwarding-local-port 6000 clone port-forward CLONE_ID
2020/06/17 17:57:33 [INFO] The clone is available by address: 127.0.0.1:6000
Initialization:
$ dblab init --environment-id stage \
--url "http://127.0.0.1:2345" \
--token "SECRET_TOKEN" \
--forwarding-server-url "ssh://user@stage.srv:22" \
--forwarding-local-port 8080
$ dblab config list
Available CLI environments:
ENV URL Forwarding server URL Forwarding local port
[ ] dev http://127.0.0.1:3000
[*] stage http://127.0.0.1:2345 ssh://user@stage.srv:22 8080
[ ] local http://local.example.com
[ ] original http://127.0.0.1:3000 ssh://john@remote.host:22 2400
Database Lab configuration example:
```yaml
current_environment: dev
environments:
dev:
url: http://127.0.0.1:3000
token: xxx
insecure: false
forwarding:
server_url: "ssh://user@1.1.1.1:22"
local_port: "9000"
Checklist
-
the MR description has been reviewed -
this MR contains text changes and they have been reviewed OR there are no texts changes -
this MR contains GUI/CLI changes and they have been reviewed OR there are no GUI/CLI changes -
this MR contains API changes, specifications reflect those changes and they have been reviewed OR there are no API changes
Closes #91 (closed)
Edited by Artyom Kartasov