diff --git a/docs/website/docs/command-reference/create-namespace.md b/docs/website/docs/command-reference/create-namespace.md index 1931510dc77..75e6004e397 100644 --- a/docs/website/docs/command-reference/create-namespace.md +++ b/docs/website/docs/command-reference/create-namespace.md @@ -10,10 +10,8 @@ To create a namespace you can run `odo create namespace `: ```shell odo create namespace mynamespace ``` - -Example - ```shell -odo create namespace mynamespace +$ odo create namespace mynamespace ✓ Namespace "mynamespace" is ready for use ✓ New namespace created and now using namespace: mynamespace ``` @@ -24,10 +22,8 @@ To create a project you can run `odo create project `: ```shell odo create project myproject ``` - -Example - ```shell -odo create project myproject +$ odo create project myproject ✓ Project "myproject" is ready for use ✓ New project created and now using project: myproject ``` diff --git a/docs/website/docs/command-reference/delete-namespace.md b/docs/website/docs/command-reference/delete-namespace.md index 895ce67cfb7..5d9274816b6 100644 --- a/docs/website/docs/command-reference/delete-namespace.md +++ b/docs/website/docs/command-reference/delete-namespace.md @@ -8,10 +8,8 @@ To delete a namespace you can run `odo delete namespace `: ```shell odo delete namespace mynamespace ``` - -Example: ```shell -odo delete namespace mynamespace +$ odo delete namespace mynamespace ✓ Namespace "mynamespace" deleted ``` @@ -21,10 +19,8 @@ To delete a project you can run `odo delete project `: ```shell odo delete project myproject ``` - -Example: ```shell -odo delete project myproject +$ odo delete project myproject ✓ Project "myproject" deleted ``` diff --git a/docs/website/docs/command-reference/describe-binding.md b/docs/website/docs/command-reference/describe-binding.md index f247b8f3139..e0b4d5d8434 100644 --- a/docs/website/docs/command-reference/describe-binding.md +++ b/docs/website/docs/command-reference/describe-binding.md @@ -35,7 +35,10 @@ For each of these resources, the following information is displayed: When the service binding are not deployed yet to the cluster: -```shell +```console +odo describe binding +``` +```console $ odo describe binding ServiceBinding used by the current component: @@ -60,7 +63,10 @@ Start "odo dev" first to see binding information. When the resources have been deployed to the cluster, the command also extracts information from the status of the resources to display information about the variables that can be used from the component. -```shell +```console +odo describe binding +``` +```console $ odo describe binding ServiceBinding used by the current component: @@ -98,7 +104,7 @@ Available binding information: ### Describe without access to Devfile -```shell +```console odo describe binding --name ``` diff --git a/docs/website/docs/command-reference/dev.md b/docs/website/docs/command-reference/dev.md index c3592a55325..6035b4fe96e 100644 --- a/docs/website/docs/command-reference/dev.md +++ b/docs/website/docs/command-reference/dev.md @@ -14,7 +14,10 @@ If you haven't already done so, you must [initialize](../command-reference/init) Afterwards, run `odo dev`: -```sh +```console +odo dev +``` +```console $ odo dev __ / \__ Developing using the my-nodejs-app Devfile @@ -73,7 +76,10 @@ For example, given the following excerpt from a Devfile: - running `odo dev` will build the application using the default `my-build` command. - running `odo dev --build-command my-build-with-version` will build the application using the `my-build-with-version` command: -```shell +```console +odo dev --build-command my-build-with-version +``` +```console $ odo dev --build-command my-build-with-version __ @@ -126,7 +132,10 @@ For example, given the following excerpt from a Devfile: - running `odo dev` will run the default `my-run` command - running `odo dev --run-command my-run-with-postgres` will run the `my-run-with-postgres` command: -```shell +```console +odo dev --run-command my-run-with-postgres +``` +```console $ odo dev --run-command my-run-with-postgres __ @@ -177,7 +186,7 @@ This command will override the `USER` Devfile variable with the value of the `US It will also override the value of the `DEBUG` Devfile variable with the `true` value. ```shell -$ odo dev --var USER --var DEBUG=true +odo dev --var USER --var DEBUG=true ``` If you create a file `config.vars` containing: @@ -190,14 +199,14 @@ DEBUG=true The following command will have the same behaviour as the previous one: ```shell -$ odo dev --var-file config.vars +odo dev --var-file config.vars ``` The following command will override the `USER` Devfile variable with the `john` value: ```shell -$ odo dev --var USER=john --var-file config.vars +odo dev --var USER=john --var-file config.vars ``` ## Devfile (Advanced Usage) diff --git a/docs/website/docs/command-reference/init.md b/docs/website/docs/command-reference/init.md index 5836c1f3186..a2fe6c877d9 100644 --- a/docs/website/docs/command-reference/init.md +++ b/docs/website/docs/command-reference/init.md @@ -33,7 +33,10 @@ The required `--name` flag indicates how the component initialized by this comma ### Interactive mode +```console +odo init ``` +```console $ odo init ? Select language: java ? Select project type: Maven Java (java-maven, registry: DefaultDevfileRegistry) @@ -52,7 +55,10 @@ To deploy your component to a cluster use "odo deploy". In this example, the devfile will be downloaded from the **Staging** registry, which is the first one in the list containing the `nodejs-react` devfile. +```console +odo preference view ``` +```console $ odo preference view Preference parameters: PARAMETER VALUE @@ -82,7 +88,10 @@ To deploy your component to a cluster use "odo deploy". In this example, the devfile will be downloaded from the **DefaultDevfileRegistry** registry, as explicitly indicated by the `--devfile-registry` flag. +```console +odo preference view ``` +```console $ odo preference view Preference parameters: PARAMETER VALUE @@ -110,7 +119,10 @@ To deploy your component to a cluster use "odo deploy". ### Non-interactive mode from a URL +```console +odo init --devfile-path https://registry.devfile.io/devfiles/nodejs-angular --name my-nodejs-app --starter nodejs-angular-starter ``` +```console $ odo init --devfile-path https://registry.devfile.io/devfiles/nodejs-angular --name my-nodejs-app --starter nodejs-angular-starter ✓ Downloading devfile from "https://registry.devfile.io/devfiles/nodejs-angular" [415ms] ✓ Downloading starter project "nodejs-angular-starter" [484ms] diff --git a/docs/website/docs/command-reference/json-output.md b/docs/website/docs/command-reference/json-output.md index 33c43919b78..cd318ca39c5 100644 --- a/docs/website/docs/command-reference/json-output.md +++ b/docs/website/docs/command-reference/json-output.md @@ -25,25 +25,37 @@ from the devfiles in the registries defined in the list of preferred registries The output of this command contains a list of devfile name and registry name: ```bash -$ odo analyze -o json +odo analyze -o json +``` +```json [ { "devfile": "nodejs", "devfileRegistry": "DefaultDevfileRegistry" } ] -$ echo $? +``` +```console +echo $? +``` +```console 0 ``` If the command is executed in an empty directory, it will return an error in the standard error stream and terminate with a non-zero exit status: ```bash -$ odo analyze -o json +odo analyze -o json +``` +```json { "message": "No valid devfile found for project in /home/user/my/empty/directory" } -$ echo $? +``` +```console +echo $? +``` +```console 1 ``` @@ -58,6 +70,8 @@ $ odo init -o json \ --name aname \ --devfile go \ --starter go-starter +``` +```json { "devfilePath": "/home/user/my-project/devfile.yaml", "devfileData": { @@ -75,7 +89,11 @@ $ odo init -o json \ "runningIn": [], "managedBy": "odo" } -$ echo $? +``` +```console +echo $? +``` +```console 0 ``` @@ -87,10 +105,16 @@ $ odo init -o json \ --name aname \ --devfile go \ --starter go-starter +``` +```json { "message": "a devfile already exists in the current directory" } -$ echo $? +``` +```console +echo $? +``` +```console 1 ``` @@ -109,7 +133,9 @@ When the `describe component` command is executed without parameter from a direc - the modes in which the component is deployed (either none, Dev, Deploy or both) ```bash -$ odo describe component -o json +odo describe component -o json +``` +```json { "devfilePath": "/home/phmartin/Documents/tests/tmp/devfile.yaml", "devfileData": { @@ -146,7 +172,9 @@ The command with name and namespace will never return information about the Devf The command with name and namespace will never return information about the forwarded ports, as the information resides in the directory of the Devfile. ```bash -$ odo describe component --name aname -o json +odo describe component --name aname -o json +``` +```json { "runningIn": ["Dev"], "managedBy": "odo" @@ -164,7 +192,9 @@ The `componentInDevfile` field gives the name of the component present in the `c In this example, the `component2` component is running in Deploy mode, and the command has been executed from a directory containing a Devfile defining a `component1` component, not running. ```bash -$ odo list --namespace project1 +odo list --namespace project1 +``` +```json { "componentInDevfile": "component1", "components": [ @@ -193,7 +223,9 @@ The `odo registry` command lists all the Devfile stacks from Devfile registries. The default output will return information found into the registry index for stacks: ```shell -$ odo registry -o json +odo registry -o json +``` +```json [ { "name": "python-django", @@ -222,7 +254,9 @@ $ odo registry -o json Using the `--details` flag, you will also get information about the Devfile: ```shell -$ odo registry --details -o json +odo registry --details -o json +``` +```json [ { "name": "python-django", @@ -275,7 +309,9 @@ the component in the `status.bindingFiles` and/or `status.bindingEnvVars` fields When a service binding resource is defined in the Devfile, and the component is not deployed, you get an output similar to: ```shell -$ odo list binding -o json +odo list binding -o json +``` +```json { "bindingsInDevfile": [ "my-nodejs-app-cluster-sample" @@ -308,7 +344,9 @@ With the same Devfile, when `odo dev` is running, you get an output similar to ```shell -$ odo list binding -o json +odo list binding -o json +``` +```json { "bindingsInDevfile": [ "my-nodejs-app-cluster-sample" @@ -361,7 +399,9 @@ you get an output similar to (note that the `.bindingsInDevfile` field is not pr ```shell -$ odo list binding -o json +odo list binding -o json +``` +```json { "bindings": [ { @@ -419,7 +459,9 @@ information from the deployed resource with the given name. Without a name, the output of the command is a list of service binding details, for example: ```shell -$ odo describe binding -o json +odo describe binding -o json +``` +```json [ { "name": "my-first-binding", @@ -497,7 +539,9 @@ $ odo describe binding -o json When specifying a name, the output is a unique service binding: ```shell -$ odo describe binding --name my-first-binding -o json +odo describe binding --name my-first-binding -o json +``` +```json { "name": "my-first-binding", "spec": { diff --git a/docs/website/docs/command-reference/list-binding.md b/docs/website/docs/command-reference/list-binding.md index e4e7e4c58e5..f0d477d4797 100644 --- a/docs/website/docs/command-reference/list-binding.md +++ b/docs/website/docs/command-reference/list-binding.md @@ -19,13 +19,10 @@ To get more information about a specific service binding, you can run the comman ## Running the Command To list all the service bindings, you can run `odo list binding`: -```shell +```console odo list binding ``` - -Example: - -```sh +```console $ odo list binding NAME APPLICATION SERVICES RUNNING IN binding-to-redis my-nodejs-app-app (Deployment) redis (Service) Dev diff --git a/docs/website/docs/command-reference/list-namespace.md b/docs/website/docs/command-reference/list-namespace.md index 7208560ea32..a7ffc9452cd 100644 --- a/docs/website/docs/command-reference/list-namespace.md +++ b/docs/website/docs/command-reference/list-namespace.md @@ -11,12 +11,10 @@ it will return a list of Project resources. ## Running the Command To list all the namespaces, you can run `odo list namespace`: -```shell +```console odo list namespace ``` - -Example - -```sh +```console $ odo list namespace ACTIVE NAME * default @@ -32,12 +30,10 @@ ACTIVE NAME Optionally, you can also use `project` as an alias to `namespace`. To list all the projects, you can run `odo list project`: - ```shell + ```console odo list project ``` - - Example - - ```sh + ```console $ odo list project ACTIVE NAME * default diff --git a/docs/website/docs/command-reference/registry.md b/docs/website/docs/command-reference/registry.md index 3b8f538de06..66d2e05bcaa 100644 --- a/docs/website/docs/command-reference/registry.md +++ b/docs/website/docs/command-reference/registry.md @@ -30,8 +30,10 @@ This flag lets you change the content of the output: For these examples, we consider we have two registries in our preferences: +```console +odo preference view ``` -shell +```console $ odo preference view Preference parameters: PARAMETER VALUE @@ -50,7 +52,10 @@ Devfile registries: To get the complete list of accessible Devfile stacks: -```shell +```console +odo registry +``` +```console $ odo registry NAME REGISTRY DESCRIPTION dotnet50 Staging Stack with .NET 5.0 @@ -68,7 +73,10 @@ $ odo registry To list the Devfile stacks from the Staging registry only: -```shell +```console +odo registry --devfile-registry Staging +``` +```console $ odo registry --devfile-registry Staging NAME REGISTRY DESCRIPTION dotnet50 Staging Stack with .NET 5.0 @@ -81,7 +89,10 @@ $ odo registry --devfile-registry Staging To list the Devfile stacks related to Maven: -```shell +```console +odo registry --filter Maven +``` +```console $ odo registry --filter Maven NAME REGISTRY DESCRIPTION java-maven Staging Upstream Maven and OpenJDK 11 @@ -96,7 +107,10 @@ $ odo registry --filter Maven To get the details of the `java-maven` Devfile in the Staging registry: -```shell +```console +odo registry --devfile java-maven --devfile-registry Staging --details +``` +```console $ odo registry --devfile java-maven --devfile-registry Staging --details Name: java-maven Display Name: Maven Java diff --git a/docs/website/docs/command-reference/remove-binding.md b/docs/website/docs/command-reference/remove-binding.md index 3d7b278d605..d74aa0a91aa 100644 --- a/docs/website/docs/command-reference/remove-binding.md +++ b/docs/website/docs/command-reference/remove-binding.md @@ -15,7 +15,7 @@ odo remove binding --name ## Examples ```shell -$ odo remove binding --name redis-service-my-nodejs-app +odo remove binding --name redis-service-my-nodejs-app ``` -There is no interactive mode for this command at the moment. \ No newline at end of file +There is no interactive mode for this command at the moment. diff --git a/docs/website/docs/command-reference/set-namespace.md b/docs/website/docs/command-reference/set-namespace.md index d0787083270..d4e7b13cca5 100644 --- a/docs/website/docs/command-reference/set-namespace.md +++ b/docs/website/docs/command-reference/set-namespace.md @@ -7,26 +7,22 @@ title: odo set namespace Executing this command inside a component directory will not update the namespace or project of the existing component. To set the current active namespace you can run `odo set namespace `: -```shell +```console odo set namespace mynamespace ``` - -Example: -```shell -odo set namespace mynamespace +```console +$ odo set namespace mynamespace ✓ Current active namespace set to "mynamespace" ``` Optionally, you can also use `project` as an alias to `namespace`. To set the current active project you can run `odo set project `: -```shell +```console odo set project myproject ``` - -Example: -```shell -odo set project myproject +```console +$ odo set project myproject ✓ Current active project set to "myproject" ``` diff --git a/docs/website/docs/user-guides/quickstart.md b/docs/website/docs/user-guides/quickstart.md index bd98538a830..40be36ee8fd 100644 --- a/docs/website/docs/user-guides/quickstart.md +++ b/docs/website/docs/user-guides/quickstart.md @@ -36,13 +36,15 @@ For Node.JS we will use the [Express](https://expressjs.com/) framework for our 1. Install Express: ```console -$ npm install express --save +npm install express --save ``` 2. Generate an example project: ```console +npx express-generator +``` +```console $ npx express-generator - warning: the default view engine will not be jade in future releases warning: use `--view=jade' or `--help' for additional options @@ -81,9 +83,11 @@ $ npx express-generator 1. Generate an example project: +```console +dotnet new mvc --name app +``` ```console $ dotnet new mvc --name app - Welcome to .NET 6.0! --------------------- SDK Version: 6.0.104 @@ -142,7 +146,7 @@ func HelloServer(w http.ResponseWriter, r *http.Request) { 2. Initialize a `go.mod` file: ```console -$ go mod init my.example.go.project +go mod init my.example.go.project ``` @@ -162,6 +166,9 @@ Now we'll initialize your application by creating a `devfile.yaml` to be deploye Let's run `odo init` and select Node.js: +```console +odo init +``` ```console $ odo init __ @@ -197,6 +204,9 @@ A `devfile.yaml` has now been added to your directory and now you're ready to st Let's run `odo init` and select .NET 6.0: +```console +odo init +``` ```console $ odo init __ @@ -237,6 +247,9 @@ A `devfile.yaml` has now been added to your directory and now you're ready to st Let's run `odo init` and select Java Spring Boot: +```console +odo init +``` ```console $ odo init __ @@ -275,6 +288,9 @@ A `devfile.yaml` has now been added to your directory and now you're ready to st Let's run `odo init` and select Go: +```console +odo init +``` ```console $ odo init __ @@ -320,6 +336,9 @@ Once you run `odo dev`, you can freely edit code in your favourite IDE and watch Let's run `odo dev` to start development on your Node.JS application: ```console +odo dev +``` +```console $ odo dev __ / \__ Developing using the my-nodejs-app Devfile @@ -345,6 +364,9 @@ Press Ctrl+c to exit `odo dev` and delete resources from the cluster Let's run `odo dev` to start development on your .NET application: +```console +odo dev +``` ```console $ odo dev __ @@ -370,6 +392,9 @@ Press Ctrl+c to exit `odo dev` and delete resources from the cluster Let's run `odo dev` to start development on your Java Spring Boot application: +```console +odo dev +``` ```console $ odo dev __ @@ -400,6 +425,9 @@ Let's run `odo dev` to start development on your .NET application: ```console odo dev +``` +```console +$ odo dev __ / \__ Developing using the my-go-app Devfile \__/ \ Namespace: default @@ -434,9 +462,11 @@ Before we begin, you must login to a container registry that we will be pushing Login to your container registry with either `podman` or `docker`: ```console -$ podman login -# or -$ docker login +podman login +``` +Or +```console +docker login ``` In order for `odo deploy` to push your image, your container registry needs to be accessible. @@ -635,6 +665,9 @@ components: Now we're ready to run `odo deploy`: +```console +odo deploy +``` ```console $ odo deploy __ @@ -834,6 +867,9 @@ components: Now we're ready to run `odo deploy`: +```console +odo deploy +``` ```console $ odo deploy __ @@ -1031,6 +1067,9 @@ components: Now we're ready to run `odo deploy`: +```console +odo deploy +``` ```console $ odo deploy __ @@ -1239,6 +1278,9 @@ components: Now we're ready to run `odo deploy`: +```console +odo deploy +``` ```console $ odo deploy __ @@ -1281,6 +1323,9 @@ After testing your application, you may optionally undeploy using the `odo delet ```console odo delete component +``` +```console +$ odo delete component Searching resources to delete, please wait... This will delete "my-app" from the namespace "default". • The component contains the following resources that will get deleted: