Skip to content

Commit

Permalink
command reference doc
Browse files Browse the repository at this point in the history
  • Loading branch information
feloy committed Jun 12, 2023
1 parent 495c568 commit 2ee19df
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/website/docs/command-reference/run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: odo run
---

`odo run` is used to manually execute commands defined in a Devfile.

<details>
<summary>Example</summary>

A command `connect` is defined in the Devfile, executing the `bash` command in the `runtime` component.

```yaml
schemaVersion: 2.2.0
[...]
commands:
- id: connect
exec:
component: runtime
commandLine: bash
[...]

```

```shell
$ odo run connect
bash-4.4$
```

</details>


For `Exec` commands, `odo dev` needs to be running, and `odo run`
will execute commands in the containers deployed by the `odo dev` command.

Standard input is redirected to the command running in the container, and the terminal is configured in Raw mode. For these reasons, any character will be redirected to the command in container, including the Ctrl-c character which can thus be used to interrupt the command in container.

The `odo run` command terminates when the command in container terminates, and the exit status of `odo run` will reflect the exit status of the distant command: it will be `0` if the command in container terminates with status `0` and will be `1` if the command in container terminates with any other status.

Resources deployed with `Apply` commands will be deployed in *Dev mode*,
and these resources will be deleted when `odo dev` terminates.

0 comments on commit 2ee19df

Please sign in to comment.