-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support creating workspaces with a workspace config JSON (#34)
* Updates to support workspaceconfig.json * Fix issue with URL regex * Fix trailing whitespace * Fixup after Artem review
- Loading branch information
Showing
6 changed files
with
282 additions
and
39 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
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
109 changes: 109 additions & 0 deletions
109
test/helpers/replies/create-workspace-from-valid-workspaceconfig.json
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,109 @@ | ||
{ | ||
"links": { | ||
"self": "http://che-kube-che.192.168.64.40.nip.io/api/workspace/workspace1ioy0lx0zg7j0jio", | ||
"ide": "http://che-kube-che.192.168.64.40.nip.io/che/inner-loop-buildah" | ||
}, | ||
"attributes": { | ||
"created": "1545089353884" | ||
}, | ||
"namespace": "che", | ||
"temporary": false, | ||
"id": "workspace1ioy0lx0zg7j0jio", | ||
"status": "STOPPED", | ||
"config": { | ||
"defaultEnv": "default", | ||
"environments": { | ||
"default": { | ||
"machines": { | ||
"ws/dev": { | ||
"attributes": { | ||
"memoryLimitBytes": "536870912" | ||
}, | ||
"servers": {}, | ||
"volumes": { | ||
"projects": { | ||
"path": "/projects" | ||
} | ||
}, | ||
"installers": [], | ||
"env": { | ||
"": "" | ||
} | ||
} | ||
}, | ||
"recipe": { | ||
"type": "kubernetes", | ||
"content": "kind: List\nitems:\n - \n apiVersion: v1\n kind: Pod\n metadata:\n name: ws\n spec:\n containers:\n - \n image: mariolet/che-plugin-dev-tooling:jug\n name: dev\n resources:\n limits:\n memory: 512Mi\n", | ||
"contentType": "application/x-yaml" | ||
} | ||
} | ||
}, | ||
"projects": [ | ||
{ | ||
"links": [], | ||
"name": "spring-petclinic", | ||
"attributes": {}, | ||
"source": { | ||
"location": "https://github.com/sleshchenko/spring-petclinic.git", | ||
"type": "git", | ||
"parameters": {} | ||
}, | ||
"path": "/spring-petclinic", | ||
"description": "", | ||
"mixins": [], | ||
"problems": [] | ||
} | ||
], | ||
"name": "inner-loop-buildah", | ||
"attributes": { | ||
"editor": "org.eclipse.che.editor.theia:1.0.0", | ||
"sidecar.theia-ide.memory_limit": "512Mi", | ||
"plugins": "che-machine-exec-plugin:0.0.1" | ||
}, | ||
"commands": [ | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && kubectl apply -f app4jug.yaml", | ||
"name": "Run Kube App", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Run" | ||
}, | ||
"type": "che" | ||
}, | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && ./mvnw package", | ||
"name": "Build Java", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Build" | ||
}, | ||
"type": "che" | ||
}, | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && buildah bud -t petclinic .", | ||
"name": "Build Container Image", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Build" | ||
}, | ||
"type": "che" | ||
}, | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && buildah push --tls-verify=false petclinic docker://$(kubectl get services -n kube-system -o jsonpath={.spec.clusterIP} registry)/mariolet/petclinic:latest", | ||
"name": "Push Container Image", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Build" | ||
}, | ||
"type": "che" | ||
}, | ||
{ | ||
"commandLine": "echo ${CHE_OSO_CLUSTER//api/console}", | ||
"name": "Get OpenShift Console URL", | ||
"attributes": {}, | ||
"type": "custom" | ||
} | ||
], | ||
"links": [] | ||
} | ||
} |
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,96 @@ | ||
{ | ||
"environments": { | ||
"default": { | ||
"recipe": { | ||
"contentType": "application/x-yaml", | ||
"type": "kubernetes", | ||
"content": "kind: List\nitems:\n - \n apiVersion: v1\n kind: Pod\n metadata:\n name: ws\n spec:\n containers:\n - \n image: mariolet/che-plugin-dev-tooling:jug\n name: dev\n resources:\n limits:\n memory: 512Mi\n" | ||
}, | ||
"machines": { | ||
"ws/dev": { | ||
"env": { | ||
"": "" | ||
}, | ||
"installers": [], | ||
"servers": {}, | ||
"volumes": { | ||
"projects": { | ||
"path": "/projects" | ||
} | ||
}, | ||
"attributes": { | ||
"memoryLimitBytes": "536870912" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"commands": [ | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && kubectl apply -f app4jug.yaml", | ||
"name": "Run Kube App", | ||
"type": "che", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Run" | ||
} | ||
}, | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && ./mvnw package", | ||
"name": "Build Java", | ||
"type": "che", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Build" | ||
} | ||
}, | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && buildah bud -t petclinic .", | ||
"name": "Build Container Image", | ||
"type": "che", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Build" | ||
} | ||
}, | ||
{ | ||
"commandLine": "cd /projects/spring-petclinic && buildah push --tls-verify=false petclinic docker://$(kubectl get services -n kube-system -o jsonpath={.spec.clusterIP} registry)/mariolet/petclinic:latest", | ||
"name": "Push Container Image", | ||
"type": "che", | ||
"attributes": { | ||
"machineName": "ws/dev", | ||
"goal": "Build" | ||
} | ||
}, | ||
{ | ||
"commandLine": "echo ${CHE_OSO_CLUSTER//api/console}", | ||
"name": "Get OpenShift Console URL", | ||
"type": "custom", | ||
"attributes": {} | ||
} | ||
], | ||
"projects": [ | ||
{ | ||
"source": { | ||
"location": "https://github.com/sleshchenko/spring-petclinic.git", | ||
"type": "git", | ||
"parameters": {} | ||
}, | ||
"links": [], | ||
"description": "", | ||
"problems": [], | ||
"mixins": [], | ||
"name": "spring-petclinic", | ||
"path": "/spring-petclinic", | ||
"attributes": {} | ||
} | ||
], | ||
"defaultEnv": "default", | ||
"name": "inner-loop-buildah", | ||
"attributes": { | ||
"editor": "org.eclipse.che.editor.theia:1.0.0", | ||
"plugins": "che-machine-exec-plugin:0.0.1", | ||
"sidecar.theia-ide.memory_limit": "512Mi" | ||
}, | ||
"links": [] | ||
} |