-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display outputs when executing
odo run
(#6865)
* Change NewRunHandler params with Options * Pass an options to RunHandler to show logs * Hide spinner and std output since outputs are displayed * Integration tests with failing command * Fix outputs * use raw terminal and local standard i/o streams * Fix podman i/o * Fix stdout/err * Test if in/out are terminal * command reference doc
- Loading branch information
Showing
12 changed files
with
248 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.