Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement agreed-on devfile 2.0 issues #35

Merged
merged 16 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
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"

davidfestal marked this conversation as resolved.
Show resolved Hide resolved
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