Skip to content

Commit

Permalink
Implement agreement on issue #10
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 7, 2020
1 parent 6c99166 commit 5b2ac1c
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 15 deletions.
3 changes: 2 additions & 1 deletion devfile-support/samples/custom-devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: "my-devfile"
schemaVersion: "2.0.0-beta"
metadata:
name: "my-devfile"
projects:
- name: "my-project"
custom:
Expand Down
3 changes: 2 additions & 1 deletion devfile-support/samples/nodejs-stack.devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
schemaVersion: 2.0.0
name: nodejs-stack
metadata:
name: nodejs-stack
projects:
- name: project
git:
Expand Down
60 changes: 60 additions & 0 deletions devfile-support/samples/petclinic-devfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
schemaVersion: 2.0.0
metadata:
name: petclinic-dev-environment
projects:
- name: petclinic
source:
type: git
location: 'git@github.com:spring-projects/spring-petclinic.git'
components:
- alias: mvn-stack
type: dockerimage
image: maven:3.5.4-jdk-8
command: ['/bin/sh', '-c']
args: ['tail -f /dev/null']
volumes:
- name: maven-repo
containerPath: /root/.m2
endpoints:
- name: spring-boot
port: 8080
attributes:
path: /api
protocol: http
public: true
env:
- name: TERM
value: xterm
mountSources: true
memoryLimit: 500M
- alias: mysql
type: kubernetes
reference: petclinic.yaml
selector:
app.kubernetes.io/name: mysql
app.kubernetes.io/component: database
app.kubernetes.io/part-of: petclinic
- alias: theia-ide
type: cheEditor
id: eclipse/theia:0.0.3
- alias: jdt.ls
type: chePlugin
id: eclipse/theia-jdtls:0.0.3
commands:
- name: build
actions:
- type: exec
component: mvn-stack
command: mvn package
workdir: /projects/spring-petclinic
- name: run
attributes:
runType: sequential
actions:
- type: start
component: mysql
timeout: 20s
- type: exec
component: mvn-stack
command: mvn spring-boot:run
workdir: /projects/spring-petclinic
3 changes: 2 additions & 1 deletion devfile-support/samples/sample-devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: "devfile example"
schemaVersion: "2.0.0"
metadata:
name: "devfile example"
projects:
- name: "my-project"
custom:
Expand Down
3 changes: 2 additions & 1 deletion devfile-support/samples/simple-devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: "myDevile"
schemaVersion: "2.0.0"
metadata:
name: "myDevile"
projects:
- name: "devworkspace-spec"
git:
Expand Down
3 changes: 2 additions & 1 deletion devfile-support/samples/with-nodejs-parent.devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: with-parent
schemaVersion: 2.0.0
metadata:
name: with-parent
parent:
uri: https://raw.githubusercontent.com/che-incubator/devworkspace-api/proposal-25-variant-1-define-stacks/devfile-support/samples/nodejs-stack.devfile.yaml
commands:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"op": "add",
"path": "/properties/metadata",
"value": { "type": "object", "description": "Optional metadata", "properties": {} }
},
{
"op": "add",
"path": "/properties/metadata/properties/version",
"value": { "type": "string", "description": "Optional semver-compatible version", "pattern": "^([1-9]+)\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$" }
},
{
"op": "add",
"path": "/properties/metadata/properties/name",
"value": { "type": "string", "description": "Optional devfile name" }
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
"path": "/description",
"value": "Devfile schema."
},
{
"op": "add",
"path": "/properties/name",
"value": { "type": "string", "description": "devfile name" }
},
{
"op": "add",
"path": "/properties/schemaVersion",
Expand All @@ -17,6 +12,6 @@
{
"op": "add",
"path": "/required",
"value": [ "name", "schemaVersion" ]
"value": [ "schemaVersion" ]
}
]
18 changes: 14 additions & 4 deletions schemas/devfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,20 @@
},
"type": "array"
},
"name": {
"type": "string",
"description": "devfile name"
"metadata": {
"type": "object",
"description": "Optional metadata",
"properties": {
"version": {
"type": "string",
"description": "Optional semver-compatible version",
"pattern": "^([1-9]+)\\.([0-9]+)\\.([0-9]+)(\\-[0-9a-z-]+(\\.[0-9a-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$"
},
"name": {
"type": "string",
"description": "Optional devfile name"
}
}
},
"schemaVersion": {
"type": "string",
Expand All @@ -791,7 +802,6 @@
},
"type": "object",
"required": [
"name",
"schemaVersion"
]
}

0 comments on commit 5b2ac1c

Please sign in to comment.