Skip to content

Commit 138161c

Browse files
jc-bergerelsony
jc-berger
authored andcommitted
added more of the odo tables throughout the authoring stacks docs
1 parent 18d50a6 commit 138161c

6 files changed

+377
-55
lines changed

Diff for: docs/modules/user-guide/partials/proc_adding-a-name-to-a-devfile.adoc

+15-23
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22
= Adding a name to a devfile
33

44
[role="_abstract"]
5-
Adding a name to a devfile is mandatory. Use the `name` or `generateName` attributes to define the name. See the following list for metadata properties in a devfile:
5+
Adding a name to a devfile is mandatory. Use the `name` attribute to define the name. See the following table for metadata properties in a devfile:
66

7-
[horizontal]
8-
Key:: metadataObject
9-
Type:: metadataObject
10-
Required:: no
11-
Description:: metadata to be used
7+
[cols="1,1,1,1"]
8+
|===
9+
|Key |Type| Required| Description
10+
11+
|name
12+
|string
13+
|yes
14+
|The name of your devfile. This name links you to the devfile registry if listed.
15+
16+
|version
17+
|string
18+
|yes
19+
|The version of your devfile.
20+
|===
1221

1322
.Prerequisites
1423

@@ -28,23 +37,6 @@ metadata:
2837
version: 2.0.0
2938
----
3039

31-
. To specify a prefix for automatically generated workspace names, define the `generateName` attribute and not the `name` attribute.
32-
** The workspace name is in the `<generateName>YYYYY` format, for example, `devfile-sample-2y7kp`. `Y` is a random charater, `[a-z0-9]`.
33-
+
34-
.Adding a generated name to a devfile
35-
36-
[source,yaml]
37-
----
38-
schemaVersion: 2.1.0
39-
metadata:
40-
generateName: devfile-sample
41-
version: 2.0.0
42-
----
43-
44-
[NOTE]
45-
46-
Defining `name` or `generateName` has the same effect when creating workspaces using a factory. The value forms the name prefix: `<name>YYYYY` or `<generateName>YYYYY`. When defining both `generateName` and `name`, `generateName` takes precedence.
47-
4840
[role="_additional-resources"]
4941
.Additional resources
5042

Diff for: docs/modules/user-guide/partials/proc_adding-commands-to-a-devfile.adoc

+104-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,111 @@
22
= Adding commands to a devfile
33

44
[role="_abstract"]
5-
A devfile allows to specify commands to be available for execution in a workspace. Every command can contain a subset of actions. These subsets are related to specific components and are executed in the component containers. See the following list for command properties in a devfile:
5+
A devfile allows you to specify commands to be available for execution in a workspace. Every command can contain a subset of actions. These subsets are related to specific components and are executed in the component containers. See the following tables for command properties in a devfile:
66

7-
[horizontal]
8-
Key:: commandObject
9-
Type:: commandObject
10-
Required:: no
11-
Description:: command to be executed in an existing component container
7+
.commandObject
8+
[cols="1,1,1,1"]
9+
|===
10+
|Key |Type| Required| Description
11+
12+
|exec
13+
|execObject
14+
|no
15+
|The exec command to run.
16+
17+
|composite
18+
|compositeObject
19+
|no
20+
|The composite command to run.
21+
|===
22+
23+
.execObject
24+
[cols="1,1,1,1"]
25+
|===
26+
|Key |Type| Required| Description
27+
28+
|id
29+
|string
30+
|yes
31+
|The ID of the command.
32+
33+
|commandLine
34+
|string
35+
|yes
36+
|The command to run.
37+
38+
|component
39+
|string
40+
|no
41+
|The component to which the action relates.
42+
43+
|label
44+
|string
45+
|no
46+
|The optional label to describe the command.
47+
48+
|workingDir
49+
|string
50+
|no
51+
|The working directory where you execute the command.
52+
53+
|group
54+
|groupObject
55+
|no
56+
|The group to which the command belongs.
57+
58+
|environment
59+
|envObject
60+
|no
61+
|The list of environment variables you use.
62+
|===
63+
64+
.compositeObject
65+
[cols="1,1,1,1"]
66+
|===
67+
|Key |Type| Required| Description
68+
69+
|id
70+
|string
71+
|yes
72+
|The ID of the command.
73+
74+
|commands
75+
|string
76+
|no
77+
|The exec commands that constitute the composite command.
78+
79+
|parallel
80+
|boolean
81+
|no
82+
|The flag that indicates if commands are executed in parallel.
83+
84+
|label
85+
|string
86+
|no
87+
|The optional label to describe the command.
88+
89+
|group
90+
|groupObject
91+
|no
92+
|The group to which the composite command belongs. The composite command cannot be of the `run` kind.
93+
|===
94+
95+
.groupObject
96+
[cols="1,1,1,1"]
97+
|===
98+
|Key |Type| Required| Description
99+
100+
|kind
101+
|string
102+
|yes
103+
|The group to which the command belongs, such as: `build`, `run`, `test`, and `debug`.
104+
105+
|isDefault
106+
|boolean
107+
|no
108+
|Identifies if it is the default command to run. Only one default command can be defined for each group.
109+
|===
12110

13111
.Prerequisites
14112

@@ -28,7 +126,6 @@ Description:: command to be executed in an existing component container
28126
* `exec`
29127
* `apply`
30128
* `composite`
31-
* `vscode-tasks`
32129

33130
+
34131
.Sample command

Diff for: docs/modules/user-guide/partials/proc_adding-components-to-a-devfile.adoc

+120-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,127 @@
22
= Adding components to a devfile
33

44
[role="_abstract"]
5-
Each component in a single devfile must have a unique name. See the following list for component properties in a devfile:
5+
Each component in a single devfile must have a unique name and use the `container` object. See the following tables for component properties in a devfile:
6+
7+
.Component object
8+
[cols="1,1,1,1"]
9+
|===
10+
|Key |Type| Required| Description
11+
12+
|container
13+
|componentObject
14+
|no
15+
|The list of containers that you use.
16+
|===
17+
18+
.containerObject
19+
[cols="1,1,1,1"]
20+
|===
21+
|Key |Type| Required| Description
22+
23+
|name
24+
|string
25+
|yes
26+
|The name of your container.
27+
28+
|image
29+
|string
30+
|yes
31+
|The image version.
32+
33+
|memoryLimit
34+
|string
35+
|no
36+
|The memory limit that you use with your container.
37+
38+
|mountSources
39+
|boolean
40+
|no
41+
|Choose to mount the source or not.
42+
43+
|sourceMapping
44+
|string
45+
|no
46+
|The path in the container where you transfer and mount the project sources. This path is available in the container through the environment, `PROJECTS_ROOT`.
47+
48+
|endpoints
49+
|endpointObject
50+
|no
51+
|The list of endpoints to use.
52+
53+
|volumeMounts
54+
|volumeMountsObject
55+
|no
56+
|The list of volumes to mount.
57+
58+
|environment
59+
|envObject
60+
|no
61+
|The list of environment variables to use.
62+
|===
63+
64+
.endpointObject
65+
[cols="1,1,1,1"]
66+
|===
67+
|Key |Type| Required| Description
68+
69+
|name
70+
|string
71+
|yes
72+
|The name of your endpoint.
73+
74+
|targetPort
75+
|integer
76+
|yes
77+
|The port number that you target.
78+
79+
|exposure
80+
|string
81+
|no
82+
|Use the following attributes to describe how to expose the endpoints on the network: `public`, `internal`, `none`.
83+
84+
|path
85+
|string
86+
|no
87+
|The path to the endpoint URL.
88+
89+
|protocol
90+
|string
91+
|no
92+
|Use the following attributes to describe the application and transport protocols of the traffic that goes through the endpoint: `http`, `https`, `ws`, `wss`, `tcp`, `udp`.
93+
94+
|secure
95+
|boolean
96+
|no
97+
|Choose to define the endpoint as secure or not.
98+
|===
99+
100+
.volumeObject
101+
[cols="1,1,1,1"]
102+
|===
103+
|Key |Type| Required| Description
104+
105+
|name
106+
|string
107+
|yes
108+
|The name of the volume components that you use.
109+
110+
|path
111+
|string
112+
|no
113+
|The path in the component container where you mount the volume.
114+
115+
|name
116+
|string
117+
|yes
118+
|The name of the volume component.
119+
120+
|size
121+
|string
122+
|no
123+
|The size of the storage you create.
124+
|===
6125

7-
[horizontal]
8-
Key:: componentObject
9-
Type:: componentObject
10-
Required:: no
11-
Description:: list of components to be used
12126

13127
.Prerequisites
14128

Diff for: docs/modules/user-guide/partials/proc_adding-event-bindings.adoc

+31-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,38 @@
22
= Adding event bindings
33

44
[role="_abstract"]
5-
This section describes how to add an event to a v2.x devfile. An event specified in a v1.x devfile still works in a v2.x devfile. See the following list for event properties in a devfile:
5+
This section describes how to add an event to a v2.x devfile. An event specified in a v1.x devfile still works in a v2.x devfile. An event can have three different type of objects:
66

7-
[horizontal]
8-
Key:: eventObject
9-
Type:: eventObject
10-
Required:: no
11-
Description:: events to be executed during a project lifecycle
7+
. preStartObject
8+
. postStartObject
9+
. preStopObject
10+
11+
.preStartObject
12+
You can execute preStart events as init containers for the project pod in the order you specify the preStart events. The devfile `commandLine` and `workingDir` are the commands for the init container. As a result, the init container overwrites either the devfile or the container image `command` and `args`. If you use a composite command with `parallel: true`, the composite command executes as Kubernetes init containers.
13+
14+
.postStartObject
15+
When you create the Kubernetes deployment for the `odo` component, execute the postStart events.
16+
17+
.preStopObject
18+
Before you delete the Kubernetes deployment for the `odo` component, execute the preStop events.
19+
20+
See the following list for event properties in a devfile:
21+
22+
.envObject
23+
[cols="1,1,1,1"]
24+
|===
25+
|Key |Type| Required| Description
26+
27+
|name
28+
|string
29+
|yes
30+
|The name of the environment variable.
31+
32+
|value
33+
|string
34+
|yes
35+
|The value of the environment variable.
36+
|===
1237

1338
.Procedure
1439

0 commit comments

Comments
 (0)