From 56d5c89c062039c7dac13b32073dc7ede6c31e8d Mon Sep 17 00:00:00 2001 From: carolina valencia Date: Wed, 22 Mar 2023 11:12:22 -0300 Subject: [PATCH 1/4] feat: move use cases to connections Signed-off-by: carolina valencia --- .../aws-resources.md | 2 +- .../ecs-exec.md} | 36 ++++++++++++++--- .../heroku-oneoff.mdx | 4 +- .../heroku-psexec.mdx | 4 +- .../http.md} | 4 +- docs/connections/index.md | 2 + .../kubernetes-exec.mdx | 4 +- .../kubernetes-oneoff.mdx | 2 +- .../kubernetes-resources.md | 10 ++--- docs/{usecases => connections}/mongodb.md | 2 +- .../mysql.md => connections/mysql-cli.md} | 0 .../mysql.md} | 4 +- docs/connections/native/_category_.json | 4 ++ .../connections/{ => native}/command-line.mdx | 4 +- .../connections/{ => native}/port-forward.mdx | 4 +- .../psql.md => connections/postgres-psql.md} | 6 +-- .../postgres.md => connections/postgres.txt} | 2 +- docs/{usecases => connections}/sqlserver.md | 2 +- docs/{usecases => connections}/ssh-bastion.md | 2 +- docs/setting-up/quickstart-builder.jsx | 32 +++++++-------- docs/usecases/ecs-exec.md | 39 ------------------- docs/usecases/index.md | 2 - docs/usecases/scripts.md | 2 +- 23 files changed, 82 insertions(+), 91 deletions(-) rename docs/{usecases => connections}/aws-resources.md (97%) rename docs/{usecases/ecs-exec-oneoff.md => connections/ecs-exec.md} (69%) rename docs/{usecases => connections}/heroku-oneoff.mdx (96%) rename docs/{usecases => connections}/heroku-psexec.mdx (98%) rename docs/{usecases/forwarding-http.md => connections/http.md} (91%) rename docs/{usecases => connections}/kubernetes-exec.mdx (97%) rename docs/{usecases => connections}/kubernetes-oneoff.mdx (98%) rename docs/{usecases => connections}/kubernetes-resources.md (82%) rename docs/{usecases => connections}/mongodb.md (97%) rename docs/{usecases/mysql.md => connections/mysql-cli.md} (100%) rename docs/{usecases/forwarding-mysql.md => connections/mysql.md} (91%) create mode 100644 docs/connections/native/_category_.json rename docs/connections/{ => native}/command-line.mdx (91%) rename docs/connections/{ => native}/port-forward.mdx (86%) rename docs/{usecases/psql.md => connections/postgres-psql.md} (94%) rename docs/{usecases/postgres.md => connections/postgres.txt} (96%) rename docs/{usecases => connections}/sqlserver.md (98%) rename docs/{usecases => connections}/ssh-bastion.md (97%) delete mode 100644 docs/usecases/ecs-exec.md diff --git a/docs/usecases/aws-resources.md b/docs/connections/aws-resources.md similarity index 97% rename from docs/usecases/aws-resources.md rename to docs/connections/aws-resources.md index 980b3cb..ec56a94 100644 --- a/docs/usecases/aws-resources.md +++ b/docs/connections/aws-resources.md @@ -1,6 +1,6 @@ --- sidebar_position: 11 -slug: /usecases/aws-resources +slug: /connections/aws-resources --- # AWS | resources diff --git a/docs/usecases/ecs-exec-oneoff.md b/docs/connections/ecs-exec.md similarity index 69% rename from docs/usecases/ecs-exec-oneoff.md rename to docs/connections/ecs-exec.md index 900c0b0..e64fd6c 100644 --- a/docs/usecases/ecs-exec-oneoff.md +++ b/docs/connections/ecs-exec.md @@ -1,11 +1,11 @@ --- -sidebar_position: 10 -slug: /usecases/ecs-exec-oneoff +sidebar_position: 9 +slug: /connections/ecs-exec --- -# AWS ECS | exec one-off +# AWS ECS -The Elastic Container Service allows executing one off tasks of any type directly into ECS tasks/containers. +Interact with Elastic Container Service executing one off tasks or an interactive session into ECS tasks/containers. :::info note It's important to configure the ECS tasks before trying this feature, please refer to the [AWS documentation first](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) @@ -21,13 +21,39 @@ It's important to configure the ECS tasks before trying this feature, please ref | `AWS_SECRET_ACCESS_KEY` | env-var | The secret key credential | | `AWS_DEFAULT_REGION` | env-var | The AWS region | +## AWS ECS - Interactive Sessions + +The AWS Elastic Container Service allows connecting to tasks and starting interactive sessions. It's possible to map these commands to Hoop to obtain interactive sessions allocating a pseudo TTY. + +:::info note +It's important to configure the ECS tasks before trying this feature, please refer to the [AWS documentation first](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) +::: + +### Connection Command + +```shell +ecs-exec.sh --interactive --cluster=$CLUSTER_NAME --service-name=$SERVICE_NAME +``` + +### How to Use + +Start an interactive session + +```shell +hoop connect my-ecs -- --pipe /bin/bash +hoop connect my-ecs -- --pipe 'rails console' +hoop connect my-ecs -- --pipe clojure +``` + +## AWS ECS - Execute one task off + ### Connection Command ```shell ecs-exec.sh --cluster=$CLUSTER_NAME --service-name=$SERVICE_NAME ``` -## How to Use +### How to Use Now it's possible to execute ruby script straight from Hoop diff --git a/docs/usecases/heroku-oneoff.mdx b/docs/connections/heroku-oneoff.mdx similarity index 96% rename from docs/usecases/heroku-oneoff.mdx rename to docs/connections/heroku-oneoff.mdx index d8d209b..471abf9 100644 --- a/docs/usecases/heroku-oneoff.mdx +++ b/docs/connections/heroku-oneoff.mdx @@ -1,11 +1,11 @@ --- sidebar_position: 7 -slug: /usecases/heroku-oneoff +slug: /connections/heroku-oneoff --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; -# Heroku one-off +# Heroku execute task one-off diff --git a/docs/usecases/heroku-psexec.mdx b/docs/connections/heroku-psexec.mdx similarity index 98% rename from docs/usecases/heroku-psexec.mdx rename to docs/connections/heroku-psexec.mdx index d2ea10a..f561903 100644 --- a/docs/usecases/heroku-psexec.mdx +++ b/docs/connections/heroku-psexec.mdx @@ -1,11 +1,11 @@ --- sidebar_position: 8 -slug: /usecases/heroku-psexec +slug: /connections/heroku-psexec --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; -# Heroku | exec +# Heroku | interactive diff --git a/docs/usecases/forwarding-http.md b/docs/connections/http.md similarity index 91% rename from docs/usecases/forwarding-http.md rename to docs/connections/http.md index a88d45f..05327ff 100644 --- a/docs/usecases/forwarding-http.md +++ b/docs/connections/http.md @@ -1,9 +1,9 @@ --- sidebar_position: 3 -slug: /usecases/forwarding-http +slug: /connections/http --- -# Port Forward | http +# Http Port Forward local ports from your private network | HTTP example. diff --git a/docs/connections/index.md b/docs/connections/index.md index a010af4..b186c79 100644 --- a/docs/connections/index.md +++ b/docs/connections/index.md @@ -2,6 +2,8 @@ Connect and interact with your internal services. +Quickstart about how to connect hoop with the services. + ```mdx-code-block import DocCardList from '@theme/DocCardList'; diff --git a/docs/usecases/kubernetes-exec.mdx b/docs/connections/kubernetes-exec.mdx similarity index 97% rename from docs/usecases/kubernetes-exec.mdx rename to docs/connections/kubernetes-exec.mdx index 50ec917..20f983d 100644 --- a/docs/usecases/kubernetes-exec.mdx +++ b/docs/connections/kubernetes-exec.mdx @@ -1,11 +1,11 @@ --- sidebar_position: 4 -slug: /usecases/k8s-exec +slug: /usecases/k8s/exec --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; -# Kubernetes | exec +# Kubernetes diff --git a/docs/usecases/kubernetes-oneoff.mdx b/docs/connections/kubernetes-oneoff.mdx similarity index 98% rename from docs/usecases/kubernetes-oneoff.mdx rename to docs/connections/kubernetes-oneoff.mdx index f72fd3c..22611fb 100644 --- a/docs/usecases/kubernetes-oneoff.mdx +++ b/docs/connections/kubernetes-oneoff.mdx @@ -1,6 +1,6 @@ --- sidebar_position: 5 -slug: /usecases/k8s-oneoff +slug: /usecases/k8s/oneoff --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; diff --git a/docs/usecases/kubernetes-resources.md b/docs/connections/kubernetes-resources.md similarity index 82% rename from docs/usecases/kubernetes-resources.md rename to docs/connections/kubernetes-resources.md index 5cca2b8..adc3231 100644 --- a/docs/usecases/kubernetes-resources.md +++ b/docs/connections/kubernetes-resources.md @@ -1,6 +1,6 @@ --- sidebar_position: 6 -slug: /usecases/k8s-resources +slug: /usecases/k8s/resources --- # Kubernetes | resources @@ -23,11 +23,11 @@ kubectl ```shell # view pods in the default namespace -hoop exec k8s -- get pods +hoop exec my-conn-k8s -- get pods # restart an app hoop exec k8s -- rollout restart deployment/myapp # scale up an app -hoop exec k8s -- scale --replicas=3 deployment/myapp +hoop exec my-conn-k8s -- scale --replicas=3 deployment/myapp ``` It's possible to narrow down the commands in distinct connections, this gives a better user experience @@ -41,6 +41,6 @@ kubectl --namespace prod rollout Then it's possible ```shell -hoop exec k8s -- restart deployment/myapp -hoop exec k8s -- undo deployment/myapp +hoop exec my-conn-k8s -- restart deployment/myapp +hoop exec my-conn-k8s -- undo deployment/myapp ``` \ No newline at end of file diff --git a/docs/usecases/mongodb.md b/docs/connections/mongodb.md similarity index 97% rename from docs/usecases/mongodb.md rename to docs/connections/mongodb.md index 7980482..7ede094 100644 --- a/docs/usecases/mongodb.md +++ b/docs/connections/mongodb.md @@ -1,6 +1,6 @@ --- sidebar_position: 16 -slug: /usecases/mongodb +slug: /connections/mongodb --- # MongoDB | mongosh cli diff --git a/docs/usecases/mysql.md b/docs/connections/mysql-cli.md similarity index 100% rename from docs/usecases/mysql.md rename to docs/connections/mysql-cli.md diff --git a/docs/usecases/forwarding-mysql.md b/docs/connections/mysql.md similarity index 91% rename from docs/usecases/forwarding-mysql.md rename to docs/connections/mysql.md index a0160b8..c142a46 100644 --- a/docs/usecases/forwarding-mysql.md +++ b/docs/connections/mysql.md @@ -1,9 +1,9 @@ --- sidebar_position: 2 -slug: /usecases/forwarding-mysql +slug: /connections/mysql --- -# Port Forward | mysql +# Mysql Port Forward local ports from your private network | MySQL example. diff --git a/docs/connections/native/_category_.json b/docs/connections/native/_category_.json new file mode 100644 index 0000000..242eff8 --- /dev/null +++ b/docs/connections/native/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Native Connections", + "position": 1 +} diff --git a/docs/connections/command-line.mdx b/docs/connections/native/command-line.mdx similarity index 91% rename from docs/connections/command-line.mdx rename to docs/connections/native/command-line.mdx index 4e2bae1..6b25fdf 100644 --- a/docs/connections/command-line.mdx +++ b/docs/connections/native/command-line.mdx @@ -1,9 +1,9 @@ --- sidebar_position: 1 -slug: /connections/command-line +slug: /connections/native/command-line --- -import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; +import ConnectOnHoopButton from './../../../src/components/ConnectOnHoopButton'; # Command Line diff --git a/docs/connections/port-forward.mdx b/docs/connections/native/port-forward.mdx similarity index 86% rename from docs/connections/port-forward.mdx rename to docs/connections/native/port-forward.mdx index 8bb9884..0737b96 100644 --- a/docs/connections/port-forward.mdx +++ b/docs/connections/native/port-forward.mdx @@ -1,9 +1,9 @@ --- sidebar_position: 2 -slug: /connections/port-forward +slug: /connections/native/port-forward --- -import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; +import ConnectOnHoopButton from './../../../src/components/ConnectOnHoopButton'; # Port Forward diff --git a/docs/usecases/psql.md b/docs/connections/postgres-psql.md similarity index 94% rename from docs/usecases/psql.md rename to docs/connections/postgres-psql.md index af4c0ff..a770638 100644 --- a/docs/usecases/psql.md +++ b/docs/connections/postgres-psql.md @@ -1,9 +1,9 @@ --- -sidebar_position: 14 -slug: /usecases/psql +sidebar_position: 3 +slug: /connections/psql --- -# Postgres | psql cli +# Postgres | psql cli An optional way to connect into postgres is using the `psql` client. It's possible to create a interactive session or execute one-off commands. diff --git a/docs/usecases/postgres.md b/docs/connections/postgres.txt similarity index 96% rename from docs/usecases/postgres.md rename to docs/connections/postgres.txt index 11dd9a6..5464e54 100644 --- a/docs/usecases/postgres.md +++ b/docs/connections/postgres.txt @@ -1,6 +1,6 @@ --- sidebar_position: 13 -slug: /usecases/postgres +slug: /connections/postgres-psql --- # Postgres diff --git a/docs/usecases/sqlserver.md b/docs/connections/sqlserver.md similarity index 98% rename from docs/usecases/sqlserver.md rename to docs/connections/sqlserver.md index 01256b0..8397b65 100644 --- a/docs/usecases/sqlserver.md +++ b/docs/connections/sqlserver.md @@ -1,6 +1,6 @@ --- sidebar_position: 15 -slug: /usecases/sqlserver +slug: /connections/sqlserver --- # SQL Server | sqlcmd cli diff --git a/docs/usecases/ssh-bastion.md b/docs/connections/ssh-bastion.md similarity index 97% rename from docs/usecases/ssh-bastion.md rename to docs/connections/ssh-bastion.md index 1b2361f..e97874d 100644 --- a/docs/usecases/ssh-bastion.md +++ b/docs/connections/ssh-bastion.md @@ -1,6 +1,6 @@ --- sidebar_position: 17 -slug: /usecases/bastion +slug: /connections/bastion --- # Bastion Server | ssh cli diff --git a/docs/setting-up/quickstart-builder.jsx b/docs/setting-up/quickstart-builder.jsx index 3ec9464..c58f0e1 100644 --- a/docs/setting-up/quickstart-builder.jsx +++ b/docs/setting-up/quickstart-builder.jsx @@ -8,24 +8,24 @@ import HerokuPlatform from './../installing-hoop-agent/heroku.mdx'; import KubernetesPlatform from './../installing-hoop-agent/kubernetes.md'; // use cases docs -import MySQLUseCase from './../usecases/forwarding-mysql.md'; -import MySQLCLIUseCase from './../usecases/mysql.md'; -import NativePostgresUseCase from './../usecases/postgres.md'; -import PostgresPSQLUseCase from './../usecases/psql.md'; -import MongoDBmongoshUseCase from './../usecases/mongodb.md'; -import KubernetesExecUseCase from './../usecases/kubernetes-exec.mdx'; -import KubernetesResourcesUseCase from './../usecases/kubernetes-resources.md'; -import HerokuExecUseCase from './../usecases/heroku-oneoff.mdx'; -import HerokuInteractiveUseCase from './../usecases/heroku-psexec.mdx'; -import AWSExecUseCase from './../usecases/ecs-exec.md'; -import AWSResourcesUseCase from './../usecases/aws-resources.md'; -import SQLServerCLIUseCase from './../usecases/sqlserver.md'; -import BastionServerUseCase from './../usecases/ssh-bastion.md'; -import PortForwardHTTPUseCase from './../usecases/forwarding-http.md'; +import MySQLUseCase from './../connections/mysql.md'; +import MySQLCLIUseCase from './../connections/mysql-cli.md'; +import NativePostgresUseCase from './../connections/postgres-psql.md'; +import PostgresPSQLUseCase from './../connections/postgres-psql.md'; +import MongoDBmongoshUseCase from './../connections/mongodb.md'; +import KubernetesExecUseCase from './../connections/kubernetes-exec.mdx'; +import KubernetesResourcesUseCase from './../connections/kubernetes-resources.md'; +import HerokuExecUseCase from './../connections/heroku-oneoff.mdx'; +import HerokuInteractiveUseCase from './../connections/heroku-psexec.mdx'; +import AWSExecUseCase from './../connections/ecs-exec.md'; +import AWSResourcesUseCase from './../connections/aws-resources.md'; +import SQLServerCLIUseCase from './../connections/sqlserver.md'; +import BastionServerUseCase from './../connections/ssh-bastion.md'; +import PortForwardHTTPUseCase from './../connections/http.md'; // connections -import CommandLineConnection from './../connections/command-line.mdx'; -import PortForwardConnection from './../connections/port-forward.mdx'; +import CommandLineConnection from './../connections/native/command-line.mdx'; +import PortForwardConnection from './../connections/native/port-forward.mdx'; import PostgresConnection from './../connections/postgres.mdx'; const docOptions = { diff --git a/docs/usecases/ecs-exec.md b/docs/usecases/ecs-exec.md deleted file mode 100644 index 851dedb..0000000 --- a/docs/usecases/ecs-exec.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -sidebar_position: 9 -slug: /usecases/ecs-exec ---- - -# AWS ECS | exec - -The AWS Elastic Container Service allows connecting to tasks and starting interactive sessions. It's possible to map these commands to Hoop to obtain interactive sessions allocating a pseudo TTY. - -:::info note -It's important to configure the ECS tasks before trying this feature, please refer to the [AWS documentation first](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) -::: - -## Connection Configuration - -| Name | Type | Description | -|------------------------ | ------- | ---------------------------------- | -| `CLUSTER_NAME` | env-var | The name or arn of the ECS Cluster | -| `SERVICE_NAME` | env-var | The name of the service on ECS | -| `AWS_ACCESS_KEY_ID` | env-var | The access key credential | -| `AWS_SECRET_ACCESS_KEY` | env-var | The secret key credential | -| `AWS_DEFAULT_REGION` | env-var | The AWS region | - -### Connection Command - -```shell -ecs-exec.sh --interactive --cluster=$CLUSTER_NAME --service-name=$SERVICE_NAME -``` - -## How to Use - -Start an interactive session - -```shell -hoop connect my-ecs -- --pipe /bin/bash -hoop connect my-ecs -- --pipe 'rails console' -hoop connect my-ecs -- --pipe clojure -``` - diff --git a/docs/usecases/index.md b/docs/usecases/index.md index f0422d9..b5c0730 100644 --- a/docs/usecases/index.md +++ b/docs/usecases/index.md @@ -1,7 +1,5 @@ # Use Cases -Examples about how to use hoop command line utility. - ```mdx-code-block import DocCardList from '@theme/DocCardList'; diff --git a/docs/usecases/scripts.md b/docs/usecases/scripts.md index 1cfe0cc..99bd5dd 100644 --- a/docs/usecases/scripts.md +++ b/docs/usecases/scripts.md @@ -3,7 +3,7 @@ sidebar_position: 16 slug: /usecases/scripts --- -# Scripts | one-off +# Execute scripts with Hoop connections Allows executing one-off scripts using the underlying Operating System tools. From 6cf78061247f3a6b8dabb7c4cceeb9bdf2ed22f8 Mon Sep 17 00:00:00 2001 From: carolina valencia Date: Fri, 31 Mar 2023 13:10:55 +0300 Subject: [PATCH 2/4] fix -npm run build Signed-off-by: carolina valencia --- docs/installing-hoop-agent/heroku.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installing-hoop-agent/heroku.mdx b/docs/installing-hoop-agent/heroku.mdx index b9c96f6..7f06164 100644 --- a/docs/installing-hoop-agent/heroku.mdx +++ b/docs/installing-hoop-agent/heroku.mdx @@ -76,5 +76,5 @@ After disconnecting it, check if there's any recorded session available at **htt See how to use the heroku cli through Hoop. - [Heroku Management Guide](../tutorials/heroku-exec.mdx) -- [Heroku ps:exec](../usecases/heroku-psexec.mdx) -- [Heroku one-off](../usecases/heroku-oneoff.mdx) +- [Heroku ps:exec](../connections/heroku-psexec.mdx) +- [Heroku one-off](../connections/heroku-oneoff.mdx) From a979e537583679fa865d458921f6661194184c9d Mon Sep 17 00:00:00 2001 From: carolina valencia Date: Mon, 29 May 2023 11:42:19 -0300 Subject: [PATCH 3/4] chore: removing folder use-case --- docs/connections/ecs-exec.md | 2 +- docs/connections/heroku-oneoff.mdx | 2 +- docs/connections/heroku-psexec.mdx | 2 +- docs/connections/http.md | 2 +- docs/connections/kubernetes-exec.mdx | 2 +- docs/connections/kubernetes-oneoff.mdx | 2 +- docs/connections/kubernetes-resources.md | 2 +- docs/connections/mysql-cli.md | 49 ++++++++++++++-------- docs/connections/mysql.md | 27 ------------ docs/connections/postgres-psql.md | 2 +- docs/connections/postgres.mdx | 2 +- docs/connections/postgres.txt | 2 +- docs/{usecases => connections}/scripts.md | 2 +- docs/connections/sqlserver.md | 2 +- docs/setting-up/quickstart-builder.jsx | 3 +- docs/usecases/_category_.json | 4 -- docs/usecases/index.md | 7 ---- docs/usecases/mysqlcli.md | 50 ----------------------- 18 files changed, 45 insertions(+), 119 deletions(-) delete mode 100644 docs/connections/mysql.md rename docs/{usecases => connections}/scripts.md (97%) delete mode 100644 docs/usecases/_category_.json delete mode 100644 docs/usecases/index.md delete mode 100644 docs/usecases/mysqlcli.md diff --git a/docs/connections/ecs-exec.md b/docs/connections/ecs-exec.md index e64fd6c..bb267dd 100644 --- a/docs/connections/ecs-exec.md +++ b/docs/connections/ecs-exec.md @@ -1,5 +1,5 @@ --- -sidebar_position: 9 +sidebar_position: 11 slug: /connections/ecs-exec --- diff --git a/docs/connections/heroku-oneoff.mdx b/docs/connections/heroku-oneoff.mdx index 471abf9..80c409d 100644 --- a/docs/connections/heroku-oneoff.mdx +++ b/docs/connections/heroku-oneoff.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 20 slug: /connections/heroku-oneoff --- diff --git a/docs/connections/heroku-psexec.mdx b/docs/connections/heroku-psexec.mdx index f561903..c2b85c9 100644 --- a/docs/connections/heroku-psexec.mdx +++ b/docs/connections/heroku-psexec.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 8 +sidebar_position: 20 slug: /connections/heroku-psexec --- diff --git a/docs/connections/http.md b/docs/connections/http.md index 05327ff..de8dd1a 100644 --- a/docs/connections/http.md +++ b/docs/connections/http.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 2 slug: /connections/http --- diff --git a/docs/connections/kubernetes-exec.mdx b/docs/connections/kubernetes-exec.mdx index 20f983d..2a1e5df 100644 --- a/docs/connections/kubernetes-exec.mdx +++ b/docs/connections/kubernetes-exec.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 7 slug: /usecases/k8s/exec --- diff --git a/docs/connections/kubernetes-oneoff.mdx b/docs/connections/kubernetes-oneoff.mdx index 22611fb..ffa8900 100644 --- a/docs/connections/kubernetes-oneoff.mdx +++ b/docs/connections/kubernetes-oneoff.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 7 slug: /usecases/k8s/oneoff --- diff --git a/docs/connections/kubernetes-resources.md b/docs/connections/kubernetes-resources.md index adc3231..3d75d47 100644 --- a/docs/connections/kubernetes-resources.md +++ b/docs/connections/kubernetes-resources.md @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 7 slug: /usecases/k8s/resources --- diff --git a/docs/connections/mysql-cli.md b/docs/connections/mysql-cli.md index cf020c6..b90211a 100644 --- a/docs/connections/mysql-cli.md +++ b/docs/connections/mysql-cli.md @@ -1,35 +1,50 @@ --- -sidebar_position: 13 -slug: /usecases/mysql +sidebar_position: 3 +slug: /connections/mysqlcli --- -# MySQL +# MySQL | mysql cli -MySQL connection is a native type where queries can be audited and the output redacted. -It forwards a passwordless TCP connection locally. +An optional way to connect into MySQL is using the `mysql` client. It's possible to create a interactive session or execute one-off commands. ## Connection Configuration -| Name | Type | Description | -|------- | ------- | ------------------------------------------- | -| `HOST` | env-var | The IP or Host of the MySQL server | -| `PORT` | env-var | The port of the MySQL server | -| `USER` | env-var | The user to connect in the MySQL server | -| `PASS` | env-var | The password to connect in the MySQL server | +| Name | Type | Description | +|------------- | ------- | ---------------------------------------------- | +| `HOST` | env-var | The IP or Host of the MySQL server | +| `PORT` | env-var | The port of the MySQL server | +| `USER` | env-var | The user to connect in the MySQL server | +| `MYSQL_PWD` | env-var | The password to connect in the MySQL server | +| `DB` | env-var | The name of the database to connect into | +### Connection Command -:::info INFO -The MySQL native connection only accepts `mysql_native_password` and `caching_sha2_password` [authentication plugins](https://dev.mysql.com/doc/refman/8.0/en/authentication-plugins.html) +```shell +mysql -h$HOST -u$USER --port=$PORT -D$DB +``` + +:::info NOTE +The `MYSQL_PWD` is mapped as an environment variable, thus there's no need to use it in the command. ::: -## MySQL Proxy Server +## How to Use + +Start an interactive session with mysql client ```shell -hoop connect mysqldb --port 3307 +hoop connect mysql ``` -Use a compatible mysql client to connect in the instance +In the same connection, one-off process can be run as well + +```shell +hoop exec mysql < moved to connections import MySQLCLIUseCase from './../connections/mysql-cli.md'; import NativePostgresUseCase from './../connections/postgres-psql.md'; import PostgresPSQLUseCase from './../connections/postgres-psql.md'; diff --git a/docs/usecases/_category_.json b/docs/usecases/_category_.json deleted file mode 100644 index 53ed586..0000000 --- a/docs/usecases/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Use Cases", - "position": 6 -} diff --git a/docs/usecases/index.md b/docs/usecases/index.md deleted file mode 100644 index b5c0730..0000000 --- a/docs/usecases/index.md +++ /dev/null @@ -1,7 +0,0 @@ -# Use Cases - -```mdx-code-block -import DocCardList from '@theme/DocCardList'; - - -``` \ No newline at end of file diff --git a/docs/usecases/mysqlcli.md b/docs/usecases/mysqlcli.md deleted file mode 100644 index f4b9b82..0000000 --- a/docs/usecases/mysqlcli.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -sidebar_position: 14 -slug: /usecases/mysqlcli ---- - -# MySQL | mysql cli - -An optional way to connect into MySQL is using the `mysql` client. It's possible to create a interactive session or execute one-off commands. - -## Connection Configuration - -| Name | Type | Description | -|------------- | ------- | ---------------------------------------------- | -| `HOST` | env-var | The IP or Host of the MySQL server | -| `PORT` | env-var | The port of the MySQL server | -| `USER` | env-var | The user to connect in the MySQL server | -| `MYSQL_PWD` | env-var | The password to connect in the MySQL server | -| `DB` | env-var | The name of the database to connect into | - -### Connection Command - -```shell -mysql -h$HOST -u$USER --port=$PORT -D$DB -``` - -:::info NOTE -The `MYSQL_PWD` is mapped as an environment variable, thus there's no need to use it in the command. -::: - -## How to Use - -Start an interactive session with mysql client - -```shell -hoop connect mysql -``` - -In the same connection, one-off process can be run as well - -```shell -hoop exec mysql < Date: Mon, 29 May 2023 12:41:24 -0300 Subject: [PATCH 4/4] chore: removing task to use session term Signed-off-by: carolina valencia --- docs/connections/ecs-exec.md | 4 ++-- docs/connections/heroku-oneoff.mdx | 2 +- docs/connections/ssh-bastion.md | 2 +- docs/plugins/review.mdx | 4 ++-- docs/plugins/runbooks/templates.md | 2 +- docs/tutorials/heroku-exec.mdx | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/connections/ecs-exec.md b/docs/connections/ecs-exec.md index bb267dd..c7d9041 100644 --- a/docs/connections/ecs-exec.md +++ b/docs/connections/ecs-exec.md @@ -5,7 +5,7 @@ slug: /connections/ecs-exec # AWS ECS -Interact with Elastic Container Service executing one off tasks or an interactive session into ECS tasks/containers. +Interact with Elastic Container Service executing one off sessions into ECS tasks/containers. :::info note It's important to configure the ECS tasks before trying this feature, please refer to the [AWS documentation first](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) @@ -45,7 +45,7 @@ hoop connect my-ecs -- --pipe 'rails console' hoop connect my-ecs -- --pipe clojure ``` -## AWS ECS - Execute one task off +## AWS ECS - Execute one session off ### Connection Command diff --git a/docs/connections/heroku-oneoff.mdx b/docs/connections/heroku-oneoff.mdx index 80c409d..53d51d7 100644 --- a/docs/connections/heroku-oneoff.mdx +++ b/docs/connections/heroku-oneoff.mdx @@ -5,7 +5,7 @@ slug: /connections/heroku-oneoff import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; -# Heroku execute task one-off +# Heroku execute session one-off diff --git a/docs/connections/ssh-bastion.md b/docs/connections/ssh-bastion.md index e97874d..0de681c 100644 --- a/docs/connections/ssh-bastion.md +++ b/docs/connections/ssh-bastion.md @@ -5,7 +5,7 @@ slug: /connections/bastion # Bastion Server | ssh cli -Hoop could act as a bastion server and connect into ssh hosts to allow execution of one-off tasks or opening interactive sessions. +Hoop could act as a bastion server and connect into ssh hosts to allow execution of one-off sessions. ## Connection Configuration diff --git a/docs/plugins/review.mdx b/docs/plugins/review.mdx index 02d96c0..e96ab9d 100644 --- a/docs/plugins/review.mdx +++ b/docs/plugins/review.mdx @@ -19,7 +19,7 @@ The command below asks for a 10 minutes access to the connection `bash` ```shell $ hoop connect bash --duration 10m -⣷ waiting task to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... +⣷ waiting session to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... ``` After approved, the user could connect again without prompting for review during 10 minutes. @@ -34,7 +34,7 @@ It will ask for a review every time a command is issued. ```shell $ hoop exec bash -i 'ls -l' -⣷ waiting task to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... +⣷ waiting session to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... ``` ## Configuring diff --git a/docs/plugins/runbooks/templates.md b/docs/plugins/runbooks/templates.md index b3ada20..23f4281 100644 --- a/docs/plugins/runbooks/templates.md +++ b/docs/plugins/runbooks/templates.md @@ -146,7 +146,7 @@ myvar = {{ .color ### asenv function The `asenv` function allows defining inputs and mapping then as environment variables in the connection runtime. -Instead of injecting the value as an input directly to the template, it will gather the value and inject as an environment variable when executing the task. +Instead of injecting the value as an input directly to the template, it will gather the value and inject as an environment variable when executing the session. The inputs could be just defined in a comment in the template, examples: diff --git a/docs/tutorials/heroku-exec.mdx b/docs/tutorials/heroku-exec.mdx index 72b0c37..0ce5437 100644 --- a/docs/tutorials/heroku-exec.mdx +++ b/docs/tutorials/heroku-exec.mdx @@ -110,6 +110,6 @@ EOF ## Conclusion -The auditing sessions and tasks could be viewed at **https://app.hoop.dev/plugins/audit** +The auditing sessions and connections could be viewed at **https://app.hoop.dev/plugins/audit** Hoop can wrap any heroku command giving more control, auditing features, redact sensitive content without losing local developer experience.