Skip to content

Commit

Permalink
Implement agreement on issue #21
Browse files Browse the repository at this point in the history
Signed-off-by: David Festal <dfestal@redhat.com>
  • Loading branch information
davidfestal committed Apr 3, 2020
1 parent 515a430 commit 8bceda9
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 2 deletions.
14 changes: 14 additions & 0 deletions deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,20 @@ spec:
description: Describes component to which given action
relates
type: string
env:
description: Optional list of environment variables that
have to be set before running the command
items:
properties:
name:
type: string
value:
type: string
required:
- name
- value
type: object
type: array
id:
description: Mandatory identifier that allows referencing
this command in composite commands, or from a parent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ spec:
component:
description: Describes component to which given action relates
type: string
env:
description: Optional list of environment variables that have
to be set before running the command
items:
properties:
name:
type: string
value:
type: string
required:
- name
- value
type: object
type: array
id:
description: Mandatory identifier that allows referencing
this command in composite commands, or from a parent, or
Expand Down
9 changes: 8 additions & 1 deletion devfile-support/samples/simple-devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ commands:
- buildSchema
- openDevfile
parallel: false
- exec:
id: helloWorld
env:
- name: "USER"
value: "John Doe"
commandLine: 'echo "Hello ${USER}"'
- custom:
id: myCustomCommand
commandClass: myCommandType
Expand All @@ -43,4 +49,5 @@ components:
image: some container image with required build tools
mountSources: true
sourceMapping: /home/src
name: "build-tools"
name: "build-tools"

7 changes: 6 additions & 1 deletion pkg/apis/workspaces/v1alpha1/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type LabeledCommand struct {
// +optional
// Optional label that provides a label for this command
// to be used in Editor UI menus for example
Label string `json:"label,omitempty"`
Label string `json:"label,omitempty"`
}

type Command struct {
Expand Down Expand Up @@ -76,6 +76,11 @@ type ExecCommand struct {

// Working directory where the command should be executed
Workdir string `json:"workdir,omitempty"`

// +optional
// Optional list of environment variables that have to be set
// before running the command
Env []EnvVar `json:"env,omitempty"`
}

type CompositeCommand struct {
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/workspaces/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions schemas/devfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@
"description": "Describes component to which given action relates",
"type": "string"
},
"env": {
"description": "Optional list of environment variables that have to be set before running the command",
"items": {
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"id": {
"description": "Mandatory identifier that allows referencing this command in composite commands, or from a parent, or in events.",
"type": "string"
Expand Down
19 changes: 19 additions & 0 deletions schemas/devworkspace-template-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@
"description": "Describes component to which given action relates",
"type": "string"
},
"env": {
"description": "Optional list of environment variables that have to be set before running the command",
"items": {
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"id": {
"description": "Mandatory identifier that allows referencing this command in composite commands, or from a parent, or in events.",
"type": "string"
Expand Down
19 changes: 19 additions & 0 deletions schemas/devworkspace-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,25 @@
"description": "Describes component to which given action relates",
"type": "string"
},
"env": {
"description": "Optional list of environment variables that have to be set before running the command",
"items": {
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"id": {
"description": "Mandatory identifier that allows referencing this command in composite commands, or from a parent, or in events.",
"type": "string"
Expand Down
19 changes: 19 additions & 0 deletions schemas/devworkspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,25 @@
"description": "Describes component to which given action relates",
"type": "string"
},
"env": {
"description": "Optional list of environment variables that have to be set before running the command",
"items": {
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"id": {
"description": "Mandatory identifier that allows referencing this command in composite commands, or from a parent, or in events.",
"type": "string"
Expand Down

0 comments on commit 8bceda9

Please sign in to comment.