├── README.md ├── devfile.plantuml ├── devfile.png ├── devfile.yaml ├── devfile_next.plantuml ├── devfile_next.png ├── docs ├── _config.yml ├── devfile.json ├── devfile.md ├── index.md └── updateSchema.sh ├── getting-started ├── angular │ ├── README.MD │ └── devfile.yaml ├── go │ ├── README.MD │ └── devfile.yaml ├── java-gradle │ ├── README.MD │ └── devfile.yaml ├── java-maven │ ├── README.MD │ └── devfile.yaml ├── nodejs │ ├── README.MD │ └── devfile.yaml ├── php │ ├── README.MD │ └── devfile.yaml ├── quarkus │ ├── README.md │ └── devfile.yaml ├── spring-boot │ ├── README.md │ └── devfile.yaml ├── spring-petclinic │ ├── README.MD │ └── devfile.yaml ├── spring-rest-guide │ ├── README.MD │ └── devfile.yaml ├── thorntail │ ├── README.MD │ └── devfile.yaml ├── vaadin-addressbook │ ├── README.MD │ └── devfile.yaml └── vertx │ ├── README.MD │ └── devfile.yaml ├── petclinic.yaml └── samples ├── README.md ├── theia-hello-world-frontend-plugin ├── dev.yaml └── devfile.yaml ├── web-java-spring-petclinic └── devfile.yaml ├── web-nodejs-sample └── devfile.yaml └── web-nodejs-with-db-sample ├── devfile.yaml ├── mongo-db.yaml └── nodejs-app.yaml /README.md: -------------------------------------------------------------------------------- 1 | # devfile v1 2 | 3 | [![Contribute](https://www.eclipse.org/che/factory-contribute.svg)](https://che.openshift.io/f?url=https://github.com/redhat-developer/devfile) 4 | 5 | ⚠️ This repository contains some information about the first version of the Devfile specification and **is currently deprecated**. 6 | 7 | ⚠️ For the current Devfile specification go [here](https://devfile.io). 8 | 9 | See explained devfile v1 documentation with examples at https://redhat-developer.github.io/devfile/ 10 | 11 | ## First Generation: 12 | 13 | ![devfile](devfile.png) 14 | 15 | [Diagram source (plantuml)](devfile.plantuml) 16 | 17 | ## Next Generation: 18 | 19 | ![devfile](devfile_next.png) 20 | 21 | [Diagram source (plantuml)](devfile_next.plantuml) 22 | -------------------------------------------------------------------------------- /devfile.plantuml: -------------------------------------------------------------------------------- 1 | @startuml devfile 2 | 3 | class Devfile { 4 | - specVersion 5 | - name 6 | - commands 7 | - tools 8 | - projects 9 | } 10 | 11 | together { 12 | class Tool 13 | class Command 14 | class Project 15 | } 16 | 17 | Devfile *-- "n" Tool 18 | Devfile *-- "n" Command 19 | Devfile *-- "n" Project 20 | 21 | class Tool { 22 | - type 23 | - alias 24 | } 25 | 26 | 27 | Tool <|-.. Dockerimage 28 | Tool <|-.. Openshift 29 | Tool <|-.. Kubernetes 30 | Tool <|-.. ChePlugin 31 | Tool <|-.. CheEditor 32 | 33 | class Command { 34 | - name 35 | - actions 36 | } 37 | 38 | Command *-- "n" CommandAction 39 | CommandAction o-- Tool 40 | 41 | class CommandAction { 42 | - type 43 | - tool 44 | - command 45 | } 46 | 47 | class Project { 48 | - name 49 | - source 50 | } 51 | 52 | Project o-- "1" ProjectSource 53 | 54 | class ProjectSource { 55 | - type 56 | - location 57 | } 58 | 59 | Project -[hidden]> Tool 60 | Tool -[hidden]> Command 61 | ProjectSource -[hidden]> CommandAction 62 | 63 | class Dockerimage { 64 | - image 65 | - memoryLimit 66 | - mountSources 67 | - volumes 68 | - env 69 | - endpoints 70 | - command 71 | - args 72 | } 73 | 74 | class Openshift { 75 | - local 76 | - localContent 77 | - selector 78 | - entrypoints 79 | } 80 | 81 | class Kubernetes { 82 | - local 83 | - localContent 84 | - selector 85 | - entrypoints 86 | } 87 | 88 | class ChePlugin #yellow { 89 | - id 90 | } 91 | note bottom of ChePlugin: Che specific 92 | 93 | class CheEditor #yellow { 94 | - id 95 | } 96 | note bottom of CheEditor: Che specific 97 | 98 | ChePlugin -[hidden]> CheEditor 99 | CheEditor -[hidden]> Dockerimage 100 | 101 | @enduml 102 | -------------------------------------------------------------------------------- /devfile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/devfile/2c72a9cd5137174b44a732e4b0aee6bd7645317a/devfile.png -------------------------------------------------------------------------------- /devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | generateName: devfile- 5 | components: 6 | - id: redhat/vscode-yaml/latest 7 | type: chePlugin 8 | -------------------------------------------------------------------------------- /devfile_next.plantuml: -------------------------------------------------------------------------------- 1 | @startuml devfile_next 2 | 3 | class Devfile { 4 | - apiVersion 5 | - metadata 6 | - commands 7 | - components 8 | - projects 9 | } 10 | 11 | together { 12 | class Metadata 13 | class Component 14 | class Command 15 | class Project 16 | } 17 | 18 | Devfile *-- "1" Metadata 19 | Devfile *-- "n" Component 20 | Devfile *-- "n" Command 21 | Devfile *-- "n" Project 22 | 23 | class Metadata { 24 | - name 25 | - generateName 26 | } 27 | 28 | class Component { 29 | - type 30 | - alias 31 | } 32 | 33 | 34 | Component <|-.. Dockerimage 35 | Component <|-.. Openshift 36 | Component <|-.. Kubernetes 37 | Component <|-.. ChePlugin 38 | Component <|-.. CheEditor 39 | 40 | class Command { 41 | - name 42 | - previewUrl 43 | - actions 44 | } 45 | 46 | Command *-- "n" CommandAction 47 | Command <|-.. PreviewUrl 48 | CommandAction o-- Component 49 | 50 | class CommandAction { 51 | - type 52 | - component 53 | - command 54 | - reference 55 | - referenceContent 56 | - workdir 57 | } 58 | 59 | class PreviewUrl { 60 | - port 61 | - path 62 | } 63 | 64 | class Project { 65 | - name 66 | - source 67 | - clonePath 68 | } 69 | 70 | Project o-- "1" ProjectSource 71 | 72 | class ProjectSource { 73 | - type 74 | - location 75 | - branch 76 | - startPoint 77 | - tag 78 | - commitId 79 | - sparseCheckoutDir 80 | } 81 | 82 | Project -[hidden]> Component 83 | Component -[hidden]> Command 84 | ProjectSource -[hidden]> CommandAction 85 | 86 | class Dockerimage { 87 | - image 88 | - memoryLimit 89 | - mountSources 90 | - volumes 91 | - env 92 | - endpoints 93 | - command 94 | - args 95 | } 96 | 97 | Dockerimage <|-.. Env 98 | Dockerimage <|-.. Volumes 99 | Dockerimage <|-.. Endpoints 100 | 101 | class Env { 102 | - name 103 | - value 104 | } 105 | 106 | class Volumes { 107 | - name 108 | - containerPath 109 | } 110 | 111 | class Endpoints { 112 | - name 113 | - port 114 | - attributes 115 | } 116 | 117 | class Openshift { 118 | - reference 119 | - referenceContent 120 | - selector 121 | - entrypoints 122 | - memoryLimit 123 | } 124 | 125 | class Kubernetes { 126 | - reference 127 | - referenceContent 128 | - selector 129 | - entrypoints 130 | - memoryLimit 131 | } 132 | 133 | class ChePlugin #yellow { 134 | - id 135 | - reference 136 | - registryUrl 137 | } 138 | note bottom of ChePlugin: Che specific 139 | 140 | class CheEditor #yellow { 141 | - id 142 | - reference 143 | - registryUrl 144 | } 145 | note bottom of CheEditor: Che specific 146 | 147 | ChePlugin -[hidden]> CheEditor 148 | CheEditor -[hidden]> Dockerimage 149 | 150 | @enduml 151 | -------------------------------------------------------------------------------- /devfile_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redhat-developer/devfile/2c72a9cd5137174b44a732e4b0aee6bd7645317a/devfile_next.png -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: Introduction to Devfile 2 | theme: jekyll-theme-slate 3 | -------------------------------------------------------------------------------- /docs/devfile.json: -------------------------------------------------------------------------------- 1 | { 2 | "meta:license": [ 3 | " Copyright (c) 2012-2019 Red Hat, Inc.", 4 | " This program and the accompanying materials are made", 5 | " available under the terms of the Eclipse Public License 2.0", 6 | " which is available at https://www.eclipse.org/legal/epl-2.0/", 7 | " SPDX-License-Identifier: EPL-2.0", 8 | " Contributors:", 9 | " Red Hat, Inc. - initial API and implementation" 10 | ], 11 | "$schema": "http://json-schema.org/draft-07/schema#", 12 | "type": "object", 13 | "title": "Devfile object", 14 | "description": "This schema describes the structure of the devfile object", 15 | "definitions": { 16 | "attributes": { 17 | "type": "object", 18 | "additionalProperties": { 19 | "type": "string" 20 | } 21 | }, 22 | "selector": { 23 | "type": "object", 24 | "additionalProperties": { 25 | "type": "string" 26 | } 27 | } 28 | }, 29 | "required": [ 30 | "apiVersion", 31 | "metadata" 32 | ], 33 | "additionalProperties": false, 34 | "properties": { 35 | "apiVersion": { 36 | "const": "1.0.0", 37 | "title": "Devfile API Version" 38 | }, 39 | "metadata": { 40 | "type": "object", 41 | "properties": { 42 | "name": { 43 | "type": "string", 44 | "minLength": 1, 45 | "title": "Devfile Name", 46 | "description": "The name of the devfile. Workspaces created from devfile, will inherit this name", 47 | "examples": [ 48 | "petclinic-dev-environment" 49 | ] 50 | }, 51 | "generateName": { 52 | "type": "string", 53 | "minLength": 1, 54 | "title": "Devfile Generate Name", 55 | "description": "Workspaces created from devfile, will use it as base and append random suffix. It's used when name is not defined.", 56 | "examples": [ 57 | "petclinic-" 58 | ] 59 | } 60 | }, 61 | "additionalProperties": false, 62 | "anyOf": [ 63 | { 64 | "required": [ 65 | "name" 66 | ] 67 | }, 68 | { 69 | "required": [ 70 | "generateName" 71 | ] 72 | } 73 | ] 74 | }, 75 | "projects": { 76 | "type": "array", 77 | "title": "The Projects List", 78 | "description": "Description of the projects, containing names and sources locations", 79 | "items": { 80 | "type": "object", 81 | "required": [ 82 | "name", 83 | "source" 84 | ], 85 | "additionalProperties": false, 86 | "properties": { 87 | "name": { 88 | "type": "string", 89 | "title": "The Project Name", 90 | "examples": [ 91 | "petclinic" 92 | ] 93 | }, 94 | "source": { 95 | "type": "object", 96 | "title": "The Project Source object", 97 | "description": "Describes the project's source - type and location", 98 | "required": [ 99 | "type", 100 | "location" 101 | ], 102 | "properties": { 103 | "type": { 104 | "type": "string", 105 | "description": "Project's source type.", 106 | "examples": [ 107 | "git", 108 | "github", 109 | "zip" 110 | ] 111 | }, 112 | "location": { 113 | "type": "string", 114 | "description": "Project's source location address. Should be URL for git and github located projects, or file:// for zip.", 115 | "examples": [ 116 | "git@github.com:spring-projects/spring-petclinic.git" 117 | ] 118 | }, 119 | "branch": { 120 | "type": "string", 121 | "description": "The name of the of the branch to check out after obtaining the source from the location. The branch has to already exist in the source otherwise the default branch is used. In case of git, this is also the name of the remote branch to push to.", 122 | "examples": [ 123 | "master", 124 | "feature-42" 125 | ] 126 | }, 127 | "startPoint": { 128 | "type": "string", 129 | "description": "The tag or commit id to reset the checked out branch to.", 130 | "examples": [ 131 | "release/4.2", 132 | "349d3ad", 133 | "v4.2.0" 134 | ] 135 | }, 136 | "tag": { 137 | "type": "string", 138 | "description": "The name of the tag to reset the checked out branch to. Note that this is equivalent to 'startPoint' and provided for convenience.", 139 | "examples": [ 140 | "v4.2.0" 141 | ] 142 | }, 143 | "commitId": { 144 | "type": "string", 145 | "description": "The id of the commit to reset the checked out branch to. Note that this is equivalent to 'startPoint' and provided for convenience.", 146 | "examples": [ 147 | "349d3ad" 148 | ] 149 | }, 150 | "sparseCheckoutDir": { 151 | "type": "string", 152 | "description": "Part of project to populate in the working directory.", 153 | "examples": [ 154 | "/core/", 155 | "core/", 156 | "core", 157 | "/wsmaster/che-core-api-workspace/", 158 | "/d*" 159 | ] 160 | } 161 | } 162 | }, 163 | "clonePath": { 164 | "type": "string", 165 | "description": "The path relative to the root of the projects to which this project should be cloned into. This is a unix-style relative path (i.e. uses forward slashes). The path is invalid if it is absolute or tries to escape the project root through the usage of '..'. If not specified, defaults to the project name." 166 | } 167 | } 168 | } 169 | }, 170 | "components": { 171 | "type": "array", 172 | "title": "The Components List", 173 | "description": "Description of the workspace components, such as editor and plugins", 174 | "items": { 175 | "type": "object", 176 | "required": [ 177 | "type" 178 | ], 179 | "if": { 180 | "properties": { 181 | "type": { 182 | "type": "string" 183 | } 184 | }, 185 | "required": [ 186 | "type" 187 | ] 188 | }, 189 | "then": { 190 | "allOf": [ 191 | { 192 | "if": { 193 | "properties": { 194 | "type": { 195 | "enum": [ 196 | "cheEditor", 197 | "chePlugin" 198 | ] 199 | } 200 | } 201 | }, 202 | "then": { 203 | "oneOf": [ 204 | { 205 | "required": [ 206 | "id" 207 | ], 208 | "not": { 209 | "required": [ 210 | "reference" 211 | ] 212 | } 213 | }, 214 | { 215 | "required": [ 216 | "reference" 217 | ], 218 | "not": { 219 | "required": [ 220 | "id" 221 | ] 222 | } 223 | } 224 | ], 225 | "properties": { 226 | "type": {}, 227 | "alias": {}, 228 | "id": { 229 | "type": "string", 230 | "description": "Describes the component id. It has the following format: {plugin/editor PUBLISHER}/{plugin/editor NAME}/{plugin/editor VERSION}", 231 | "pattern": "[a-z0-9_\\-.]+/[a-z0-9_\\-.]+/[a-z0-9_\\-.]+$", 232 | "examples": [ 233 | "eclipse/maven-jdk8/1.0.0" 234 | ] 235 | }, 236 | "reference": { 237 | "description": "Describes raw location of plugin yaml file.", 238 | "type": "string", 239 | "examples": [ 240 | "https://pastebin.com/raw/kYprWiNB" 241 | ] 242 | }, 243 | "registryUrl": { 244 | "description": "Describes URL of custom plugin registry.", 245 | "type": "string", 246 | "pattern": "^(https?://)[a-zA-Z0-9_\\-./]+", 247 | "examples": [ 248 | "https://che-plugin-registry.openshift.io/v3/" 249 | ] 250 | }, 251 | "memoryLimit": { 252 | "type": "string", 253 | "description": "Describes memory limit for the component. You can express memory as a plain integer or as a fixed-point integer using one of these suffixes: E, P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki", 254 | "examples": [ 255 | "128974848", 256 | "129e6", 257 | "129M", 258 | "123Mi" 259 | ] 260 | } 261 | } 262 | } 263 | }, 264 | { 265 | "if": { 266 | "properties": { 267 | "type": { 268 | "enum": [ 269 | "cheEditor" 270 | ] 271 | } 272 | } 273 | }, 274 | "then": { 275 | "additionalProperties": false, 276 | "properties": { 277 | "type": {}, 278 | "alias": {}, 279 | "id": {}, 280 | "env": {}, 281 | "reference": {}, 282 | "registryUrl": {}, 283 | "memoryLimit": {} 284 | } 285 | } 286 | }, 287 | { 288 | "if": { 289 | "properties": { 290 | "type": { 291 | "enum": [ 292 | "chePlugin" 293 | ] 294 | } 295 | } 296 | }, 297 | "then": { 298 | "additionalProperties": false, 299 | "properties": { 300 | "type": {}, 301 | "alias": {}, 302 | "id": {}, 303 | "env": {}, 304 | "memoryLimit": {}, 305 | "reference": {}, 306 | "registryUrl": {}, 307 | "preferences": { 308 | "type": "object", 309 | "description": "Additional plugin preferences", 310 | "examples": [ 311 | "{\"java.home\": \"/home/user/jdk11\", \"java.jdt.ls.vmargs\": \"-Xmx1G\"}" 312 | ], 313 | "additionalProperties": { 314 | "type": [ 315 | "boolean", 316 | "string", 317 | "number" 318 | ] 319 | } 320 | } 321 | } 322 | } 323 | }, 324 | { 325 | "if": { 326 | "properties": { 327 | "type": { 328 | "enum": [ 329 | "kubernetes", 330 | "openshift" 331 | ] 332 | } 333 | } 334 | }, 335 | "then": { 336 | "anyOf": [ 337 | { 338 | "required": [ 339 | "reference" 340 | ], 341 | "additionalProperties": true 342 | }, 343 | { 344 | "required": [ 345 | "referenceContent" 346 | ], 347 | "additionalProperties": true 348 | } 349 | ], 350 | "additionalProperties": false, 351 | "properties": { 352 | "type": {}, 353 | "alias": {}, 354 | "mountSources": {}, 355 | "env": {}, 356 | "reference": { 357 | "description": "Describes absolute or devfile-relative location of Kubernetes list yaml file. Applicable only for 'kubernetes' and 'openshift' type components", 358 | "type": "string", 359 | "examples": [ 360 | "petclinic-app.yaml" 361 | ] 362 | }, 363 | "referenceContent": { 364 | "description": "Inlined content of a file specified in field 'reference'", 365 | "type": "string", 366 | "examples": [ 367 | "{\"kind\":\"List\",\"items\":[{\"apiVersion\":\"v1\",\"kind\":\"Pod\",\"metadata\":{\"name\":\"ws\"},\"spec\":{\"containers\":[{\"image\":\"eclipse/che-dev:nightly\"}]}}]}" 368 | ] 369 | }, 370 | "selector": { 371 | "$ref": "#/definitions/selector", 372 | "description": "Describes the objects selector for the recipe type components. Allows to pick-up only selected items from k8s/openshift list", 373 | "examples": [ 374 | "{\n \"app.kubernetes.io/name\" : \"mysql\", \n \"app.kubernetes.io/component\" : \"database\", \n \"app.kubernetes.io/part-of\" : \"petclinic\" \n}" 375 | ] 376 | }, 377 | "entrypoints": { 378 | "type": "array", 379 | "items": { 380 | "type": "object", 381 | "properties": { 382 | "parentName": { 383 | "type": "string", 384 | "description": "The name of the top level object in the referenced object list in which to search for containers. If not specified, the objects to search through can have any name." 385 | }, 386 | "containerName": { 387 | "type": "string", 388 | "description": "The name of the container to apply the entrypoint to. If not specified, the entrypoint is modified on all matching containers." 389 | }, 390 | "parentSelector": { 391 | "$ref": "#/definitions/selector", 392 | "description": "The selector on labels of the top level objects in the referenced list in which to search for containers. If not specified, the objects to search through can have any labels." 393 | }, 394 | "command": { 395 | "type": "array", 396 | "items": { 397 | "type": "string" 398 | }, 399 | "default": null, 400 | "description": "The command to run in the component instead of the default one provided in the image of the container. Defaults to null, meaning use whatever is defined in the image.", 401 | "examples": [ 402 | "['/bin/sh', '-c']" 403 | ] 404 | }, 405 | "args": { 406 | "type": "array", 407 | "items": { 408 | "type": "string" 409 | }, 410 | "default": null, 411 | "description": "The arguments to supply to the command running the component. The arguments are supplied either to the default command provided in the image of the container or to the overridden command. Defaults to null, meaning use whatever is defined in the image.", 412 | "examples": [ 413 | "['-R', '-f']" 414 | ] 415 | } 416 | } 417 | } 418 | } 419 | } 420 | } 421 | }, 422 | { 423 | "if": { 424 | "properties": { 425 | "type": { 426 | "enum": [ 427 | "dockerimage" 428 | ] 429 | } 430 | } 431 | }, 432 | "then": { 433 | "required": [ 434 | "image", 435 | "memoryLimit" 436 | ], 437 | "additionalProperties": false, 438 | "properties": { 439 | "type": {}, 440 | "alias": {}, 441 | "mountSources": {}, 442 | "env": {}, 443 | "image": { 444 | "type": "string", 445 | "description": "Specifies the docker image that should be used for component", 446 | "examples": [ 447 | "eclipse/maven-jdk8:1.0.0" 448 | ] 449 | }, 450 | "memoryLimit": { 451 | "type": "string", 452 | "description": "Describes memory limit for the component. You can express memory as a plain integer or as a fixed-point integer using one of these suffixes: E, P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki", 453 | "examples": [ 454 | "128974848", 455 | "129e6", 456 | "129M", 457 | "123Mi" 458 | ] 459 | }, 460 | "command": { 461 | "type": "array", 462 | "items": { 463 | "type": "string" 464 | }, 465 | "default": null, 466 | "description": "The command to run in the dockerimage component instead of the default one provided in the image. Defaults to null, meaning use whatever is defined in the image.", 467 | "examples": [ 468 | "['/bin/sh', '-c']" 469 | ] 470 | }, 471 | "args": { 472 | "type": "array", 473 | "items": { 474 | "type": "string" 475 | }, 476 | "default": null, 477 | "description": "The arguments to supply to the command running the dockerimage component. The arguments are supplied either to the default command provided in the image or to the overridden command. Defaults to null, meaning use whatever is defined in the image.", 478 | "examples": [ 479 | "['-R', '-f']" 480 | ] 481 | }, 482 | "volumes": { 483 | "type": "array", 484 | "description": "Describes volumes which should be mount to component", 485 | "items": { 486 | "type": "object", 487 | "description": "Describe volume that should be mount to component", 488 | "required": [ 489 | "name", 490 | "containerPath" 491 | ], 492 | "properties": { 493 | "name": { 494 | "type": "string", 495 | "title": "The Volume Name", 496 | "description": "The volume name. If several components mount the same volume then they will reuse the volume and will be able to access to the same files", 497 | "examples": [ 498 | "my-data" 499 | ] 500 | }, 501 | "containerPath": { 502 | "type": "string", 503 | "title": "The path where volume should be mount to container", 504 | "examples": [ 505 | "/home/user/data" 506 | ] 507 | } 508 | } 509 | } 510 | }, 511 | "endpoints": { 512 | "type": "array", 513 | "description": "Describes dockerimage component endpoints", 514 | "items": { 515 | "name": "object", 516 | "description": "Describes dockerimage component endpoint", 517 | "required": [ 518 | "name", 519 | "port" 520 | ], 521 | "properties": { 522 | "name": { 523 | "type": "string", 524 | "title": "The Endpoint Name", 525 | "description": "The Endpoint name" 526 | }, 527 | "port": { 528 | "type": "integer", 529 | "title": "The Endpoint Port", 530 | "description": "The container port that should be used as endpoint" 531 | }, 532 | "attributes": { 533 | "type": "object", 534 | "public": { 535 | "type": "boolean", 536 | "description": "Identifies endpoint as workspace internally or externally accessible.", 537 | "default": "true" 538 | }, 539 | "secure": { 540 | "type": "boolean", 541 | "description": "Identifies server as secure or non-secure. Requests to secure servers will be authenticated and must contain machine token", 542 | "default": "false" 543 | }, 544 | "discoverable": { 545 | "type": "boolean", 546 | "description": "Identifies endpoint as accessible by its name.", 547 | "default": "false" 548 | }, 549 | "protocol": { 550 | "type": "boolean", 551 | "description": "Defines protocol that should be used for communication with endpoint. Is used for endpoint URL evaluation" 552 | }, 553 | "additionalProperties": { 554 | "type": "string" 555 | }, 556 | "javaType": "java.util.Map" 557 | } 558 | } 559 | } 560 | } 561 | } 562 | } 563 | } 564 | ] 565 | }, 566 | "properties": { 567 | "alias": { 568 | "description": "The name using which other places of this devfile (like commands) can refer to this component. This attribute is optional but must be unique in the devfile if specified.", 569 | "type": "string", 570 | "examples": [ 571 | "mvn-stack" 572 | ] 573 | }, 574 | "type": { 575 | "description": "Describes type of the component, e.g. whether it is an plugin or editor or other type", 576 | "enum": [ 577 | "cheEditor", 578 | "chePlugin", 579 | "kubernetes", 580 | "openshift", 581 | "dockerimage" 582 | ], 583 | "examples": [ 584 | "chePlugin", 585 | "cheEditor", 586 | "kubernetes", 587 | "openshift", 588 | "dockerimage" 589 | ] 590 | }, 591 | "mountSources": { 592 | "type": "boolean", 593 | "description": "Describes whether projects sources should be mount to the component. `CHE_PROJECTS_ROOT` environment variable should contains a path where projects sources are mount", 594 | "default": "false" 595 | }, 596 | "env": { 597 | "type": "array", 598 | "description": "The environment variables list that should be set to docker container", 599 | "items": { 600 | "type": "object", 601 | "description": "Describes environment variable", 602 | "required": [ 603 | "name", 604 | "value" 605 | ], 606 | "properties": { 607 | "name": { 608 | "type": "string", 609 | "title": "The Environment Variable Name", 610 | "description": "The environment variable name" 611 | }, 612 | "value": { 613 | "type": "string", 614 | "title": "The Environment Variable Value", 615 | "description": "The environment variable value" 616 | } 617 | } 618 | } 619 | } 620 | }, 621 | "additionalProperties": true 622 | } 623 | }, 624 | "commands": { 625 | "type": "array", 626 | "title": "The Commands List", 627 | "description": "Description of the predefined commands to be available in workspace", 628 | "items": { 629 | "type": "object", 630 | "additionalProperties": false, 631 | "required": [ 632 | "name", 633 | "actions" 634 | ], 635 | "properties": { 636 | "name": { 637 | "description": "Describes the name of the command. Should be unique per commands set.", 638 | "type": "string", 639 | "examples": [ 640 | "build" 641 | ] 642 | }, 643 | "attributes": { 644 | "description": "Additional command attributes", 645 | "$ref": "#/definitions/attributes" 646 | }, 647 | "actions": { 648 | "type": "array", 649 | "description": "List of the actions of given command. Now the only one command must be specified in list but there are plans to implement supporting multiple actions commands.", 650 | "title": "The Command Actions List", 651 | "minItems": 1, 652 | "maxItems": 1, 653 | "items": { 654 | "oneOf": [ 655 | { 656 | "properties": { 657 | "type": {}, 658 | "component": {}, 659 | "command": {}, 660 | "workdir": {} 661 | }, 662 | "required": [ 663 | "type", 664 | "component", 665 | "command" 666 | ], 667 | "additionalProperties": false 668 | }, 669 | { 670 | "properties": { 671 | "type": {}, 672 | "reference": {}, 673 | "referenceContent": {} 674 | }, 675 | "anyOf": [ 676 | { 677 | "required": [ 678 | "type", 679 | "reference" 680 | ], 681 | "additionalProperties": true 682 | }, 683 | { 684 | "required": [ 685 | "type", 686 | "referenceContent" 687 | ], 688 | "additionalProperties": true 689 | } 690 | ], 691 | "additionalProperties": false 692 | } 693 | ], 694 | "type": "object", 695 | "properties": { 696 | "type": { 697 | "description": "Describes action type", 698 | "type": "string", 699 | "examples": [ 700 | "exec" 701 | ] 702 | }, 703 | "component": { 704 | "type": "string", 705 | "description": "Describes component to which given action relates", 706 | "examples": [ 707 | "mvn-stack" 708 | ] 709 | }, 710 | "command": { 711 | "type": "string", 712 | "description": "The actual action command-line string", 713 | "examples": [ 714 | "mvn package" 715 | ] 716 | }, 717 | "workdir": { 718 | "type": "string", 719 | "description": "Working directory where the command should be executed", 720 | "examples": [ 721 | "/projects/spring-petclinic" 722 | ] 723 | }, 724 | "reference": { 725 | "type": "string", 726 | "description": "the path relative to the location of the devfile to the configuration file defining one or more actions in the editor-specific format", 727 | "examples": [ 728 | "../ide-config/launch.json" 729 | ] 730 | }, 731 | "referenceContent": { 732 | "type": "string", 733 | "description": "The content of the referenced configuration file that defines one or more actions in the editor-specific format", 734 | "examples": [ 735 | "{\"version\": \"2.0.0\",\n \"tasks\": [\n {\n \"type\": \"typescript\",\n \"tsconfig\": \"tsconfig.json\",\n \"problemMatcher\": [\n \"$tsc\"\n ],\n \"group\": {\n \"kind\": \"build\",\n \"isDefault\": true\n }\n }\n ]}" 736 | ] 737 | } 738 | } 739 | } 740 | }, 741 | "previewUrl": { 742 | "type": "object", 743 | "required": [ 744 | "port" 745 | ], 746 | "properties": { 747 | "port": { 748 | "type": "number", 749 | "minimum": 0, 750 | "maximum": 65535 751 | }, 752 | "path": { 753 | "type": "string" 754 | } 755 | } 756 | } 757 | } 758 | } 759 | }, 760 | "attributes": { 761 | "type": "object", 762 | "editorFree": { 763 | "type": "boolean", 764 | "description": "Defines that no editor is needed and default one should not be provisioned. Defaults to `false`.", 765 | "default": "false" 766 | }, 767 | "persistVolumes": { 768 | "type": "boolean", 769 | "description": "Defines whether volumes should be stored or not. Defaults to `true`. In case of `false` workspace volumes will be created as `emptyDir`. The data in the `emptyDir` volume is deleted forever when a workspace Pod is removed for any reason(pod is crashed, workspace is restarted).", 770 | "default": "true" 771 | }, 772 | "additionalProperties": { 773 | "type": "string" 774 | }, 775 | "javaType": "java.util.Map" 776 | } 777 | } 778 | } -------------------------------------------------------------------------------- /docs/devfile.md: -------------------------------------------------------------------------------- 1 | # Devfile object Schema 2 | 3 | ``` 4 | 5 | ``` 6 | 7 | This schema describes the structure of the devfile object 8 | 9 | | Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Defined In | 10 | | ------------------- | ---------- | ------------ | ------------ | ----------------- | --------------------- | ---------- | 11 | | Can be instantiated | Yes | Experimental | No | Forbidden | Forbidden | | 12 | 13 | # Devfile object Properties 14 | 15 | | Property | Type | Required | Nullable | Defined by | 16 | | ------------------------- | ---------- | ------------ | -------- | ---------------------------- | 17 | | [apiVersion](#apiversion) | `const` | **Required** | No | Devfile object (this schema) | 18 | | [attributes](#attributes) | `object` | Optional | No | Devfile object (this schema) | 19 | | [commands](#commands) | `object[]` | Optional | No | Devfile object (this schema) | 20 | | [components](#components) | `object[]` | Optional | No | Devfile object (this schema) | 21 | | [metadata](#metadata) | `object` | **Required** | No | Devfile object (this schema) | 22 | | [projects](#projects) | `object[]` | Optional | No | Devfile object (this schema) | 23 | 24 | ## apiVersion 25 | 26 | ### Devfile API Version 27 | 28 | `apiVersion` 29 | 30 | - is **required** 31 | - type: `const` 32 | - defined in this schema 33 | 34 | The value of this property **must** be equal to: 35 | 36 | ```json 37 | "1.0.0" 38 | ``` 39 | 40 | ## attributes 41 | 42 | `attributes` 43 | 44 | - is optional 45 | - type: `object` 46 | - defined in this schema 47 | 48 | ### attributes Type 49 | 50 | `object` with following properties: 51 | 52 | | Property | Type | Required | 53 | | -------- | ---- | -------- | 54 | 55 | 56 | ## commands 57 | 58 | ### The Commands List 59 | 60 | Description of the predefined commands to be available in workspace 61 | 62 | `commands` 63 | 64 | - is optional 65 | - type: `object[]` 66 | - defined in this schema 67 | 68 | ### commands Type 69 | 70 | Array type: `object[]` 71 | 72 | All items must be of the type: `object` with following properties: 73 | 74 | | Property | Type | Required | 75 | | ------------ | ------ | ------------ | 76 | | `actions` | array | **Required** | 77 | | `attributes` | | Optional | 78 | | `name` | string | **Required** | 79 | | `previewUrl` | object | Optional | 80 | 81 | #### actions 82 | 83 | ##### The Command Actions List 84 | 85 | List of the actions of given command. Now the only one command must be specified in list but there are plans to 86 | implement supporting multiple actions commands. 87 | 88 | `actions` 89 | 90 | - is **required** 91 | - type: `object[]`\* between `1` and `1` items in the array 92 | 93 | ##### actions Type 94 | 95 | Array type: `object[]` 96 | 97 | All items must be of the type: `object` with following properties: 98 | 99 | | Property | Type | Required | 100 | | ------------------ | ------ | -------- | 101 | | `command` | string | Optional | 102 | | `component` | string | Optional | 103 | | `reference` | string | Optional | 104 | | `referenceContent` | string | Optional | 105 | | `type` | string | Optional | 106 | | `workdir` | string | Optional | 107 | 108 | #### command 109 | 110 | The actual action command-line string 111 | 112 | `command` 113 | 114 | - is optional 115 | - type: `string` 116 | 117 | ##### command Type 118 | 119 | `string` 120 | 121 | ##### command Example 122 | 123 | ```json 124 | mvn package 125 | ``` 126 | 127 | #### component 128 | 129 | Describes component to which given action relates 130 | 131 | `component` 132 | 133 | - is optional 134 | - type: `string` 135 | 136 | ##### component Type 137 | 138 | `string` 139 | 140 | ##### component Example 141 | 142 | ```json 143 | mvn - stack 144 | ``` 145 | 146 | #### reference 147 | 148 | the path relative to the location of the devfile to the configuration file defining one or more actions in the 149 | editor-specific format 150 | 151 | `reference` 152 | 153 | - is optional 154 | - type: `string` 155 | 156 | ##### reference Type 157 | 158 | `string` 159 | 160 | ##### reference Example 161 | 162 | ```json 163 | ../ide-config/launch.json 164 | ``` 165 | 166 | #### referenceContent 167 | 168 | The content of the referenced configuration file that defines one or more actions in the editor-specific format 169 | 170 | `referenceContent` 171 | 172 | - is optional 173 | - type: `string` 174 | 175 | ##### referenceContent Type 176 | 177 | `string` 178 | 179 | ##### referenceContent Example 180 | 181 | ```json 182 | { 183 | "version": "2.0.0", 184 | "tasks": [ 185 | { 186 | "type": "typescript", 187 | "tsconfig": "tsconfig.json", 188 | "problemMatcher": ["$tsc"], 189 | "group": { 190 | "kind": "build", 191 | "isDefault": true 192 | } 193 | } 194 | ] 195 | } 196 | ``` 197 | 198 | #### type 199 | 200 | Describes action type 201 | 202 | `type` 203 | 204 | - is optional 205 | - type: `string` 206 | 207 | ##### type Type 208 | 209 | `string` 210 | 211 | ##### type Example 212 | 213 | ```json 214 | exec 215 | ``` 216 | 217 | #### workdir 218 | 219 | Working directory where the command should be executed 220 | 221 | `workdir` 222 | 223 | - is optional 224 | - type: `string` 225 | 226 | ##### workdir Type 227 | 228 | `string` 229 | 230 | ##### workdir Example 231 | 232 | ```json 233 | /projects/ginprs - petclinic 234 | ``` 235 | 236 | #### attributes 237 | 238 | Additional command attributes 239 | 240 | `attributes` 241 | 242 | - is optional 243 | - type: reference 244 | 245 | ##### attributes Type 246 | 247 | - []() – `#/definitions/attributes` 248 | 249 | #### name 250 | 251 | Describes the name of the command. Should be unique per commands set. 252 | 253 | `name` 254 | 255 | - is **required** 256 | - type: `string` 257 | 258 | ##### name Type 259 | 260 | `string` 261 | 262 | ##### name Example 263 | 264 | ```json 265 | build 266 | ``` 267 | 268 | #### previewUrl 269 | 270 | `previewUrl` 271 | 272 | - is optional 273 | - type: `object` 274 | 275 | ##### previewUrl Type 276 | 277 | `object` with following properties: 278 | 279 | | Property | Type | Required | 280 | | -------- | ------ | ------------ | 281 | | `path` | string | Optional | 282 | | `port` | number | **Required** | 283 | 284 | #### path 285 | 286 | `path` 287 | 288 | - is optional 289 | - type: `string` 290 | 291 | ##### path Type 292 | 293 | `string` 294 | 295 | #### port 296 | 297 | `port` 298 | 299 | - is **required** 300 | - type: `number` 301 | 302 | ##### port Type 303 | 304 | `number` 305 | 306 | - minimum value: `0` 307 | - maximum value: `65535` 308 | 309 | ## components 310 | 311 | ### The Components List 312 | 313 | Description of the workspace components, such as editor and plugins 314 | 315 | `components` 316 | 317 | - is optional 318 | - type: `object[]` 319 | - defined in this schema 320 | 321 | ### components Type 322 | 323 | Array type: `object[]` 324 | 325 | All items must be of the type: `object` with following properties: 326 | 327 | | Property | Type | Required | Default | 328 | | -------------- | ------- | ------------ | --------- | 329 | | `alias` | string | Optional | | 330 | | `env` | array | Optional | | 331 | | `mountSources` | boolean | Optional | `"false"` | 332 | | `type` | | **Required** | | 333 | 334 | #### alias 335 | 336 | The name using which other places of this devfile (like commands) can refer to this component. This attribute is 337 | optional but must be unique in the devfile if specified. 338 | 339 | `alias` 340 | 341 | - is optional 342 | - type: `string` 343 | 344 | ##### alias Type 345 | 346 | `string` 347 | 348 | ##### alias Example 349 | 350 | ```json 351 | mvn - stack 352 | ``` 353 | 354 | #### env 355 | 356 | The environment variables list that should be set to docker container 357 | 358 | `env` 359 | 360 | - is optional 361 | - type: `object[]` 362 | 363 | ##### env Type 364 | 365 | Array type: `object[]` 366 | 367 | All items must be of the type: `object` with following properties: 368 | 369 | | Property | Type | Required | 370 | | -------- | ------ | ------------ | 371 | | `name` | string | **Required** | 372 | | `value` | string | **Required** | 373 | 374 | #### name 375 | 376 | ##### The Environment Variable Name 377 | 378 | The environment variable name 379 | 380 | `name` 381 | 382 | - is **required** 383 | - type: `string` 384 | 385 | ##### name Type 386 | 387 | `string` 388 | 389 | #### value 390 | 391 | ##### The Environment Variable Value 392 | 393 | The environment variable value 394 | 395 | `value` 396 | 397 | - is **required** 398 | - type: `string` 399 | 400 | ##### value Type 401 | 402 | `string` 403 | 404 | Describes environment variable 405 | 406 | #### mountSources 407 | 408 | Describes whether projects sources should be mount to the component. `CHE_PROJECTS_ROOT` environment variable should 409 | contains a path where projects sources are mount 410 | 411 | `mountSources` 412 | 413 | - is optional 414 | - type: `boolean` 415 | - default: `"false"` 416 | 417 | ##### mountSources Type 418 | 419 | `boolean` 420 | 421 | #### type 422 | 423 | Describes type of the component, e.g. whether it is an plugin or editor or other type 424 | 425 | `type` 426 | 427 | - is **required** 428 | - type: `enum` 429 | 430 | The value of this property **must** be equal to one of the [known values below](#components-known-values). 431 | 432 | ##### type Known Values 433 | 434 | | Value | Description | 435 | | ------------- | ----------- | 436 | | `cheEditor` | | 437 | | `chePlugin` | | 438 | | `kubernetes` | | 439 | | `openshift` | | 440 | | `dockerimage` | | 441 | 442 | ##### type Examples 443 | 444 | ```json 445 | chePlugin 446 | ``` 447 | 448 | ```json 449 | cheEditor 450 | ``` 451 | 452 | ```json 453 | kubernetes 454 | ``` 455 | 456 | ```json 457 | openshift 458 | ``` 459 | 460 | ```json 461 | dockerimage 462 | ``` 463 | 464 | ## metadata 465 | 466 | `metadata` 467 | 468 | - is **required** 469 | - type: `object` 470 | - defined in this schema 471 | 472 | ### metadata Type 473 | 474 | `object` with following properties: 475 | 476 | | Property | Type | Required | 477 | | -------------- | ------ | -------- | 478 | | `generateName` | string | Optional | 479 | | `name` | string | Optional | 480 | 481 | #### generateName 482 | 483 | ##### Devfile Generate Name 484 | 485 | Workspaces created from devfile, will use it as base and append random suffix. It's used when name is not defined. 486 | 487 | `generateName` 488 | 489 | - is optional 490 | - type: `string` 491 | 492 | ##### generateName Type 493 | 494 | `string` 495 | 496 | - minimum length: 1 characters 497 | 498 | ##### generateName Example 499 | 500 | ```json 501 | petclinic- 502 | ``` 503 | 504 | #### name 505 | 506 | ##### Devfile Name 507 | 508 | The name of the devfile. Workspaces created from devfile, will inherit this name 509 | 510 | `name` 511 | 512 | - is optional 513 | - type: `string` 514 | 515 | ##### name Type 516 | 517 | `string` 518 | 519 | - minimum length: 1 characters 520 | 521 | ##### name Example 522 | 523 | ```json 524 | petclinic - dev - environment 525 | ``` 526 | 527 | ## projects 528 | 529 | ### The Projects List 530 | 531 | Description of the projects, containing names and sources locations 532 | 533 | `projects` 534 | 535 | - is optional 536 | - type: `object[]` 537 | - defined in this schema 538 | 539 | ### projects Type 540 | 541 | Array type: `object[]` 542 | 543 | All items must be of the type: `object` with following properties: 544 | 545 | | Property | Type | Required | 546 | | ----------- | ------ | ------------ | 547 | | `clonePath` | string | Optional | 548 | | `name` | string | **Required** | 549 | | `source` | object | **Required** | 550 | 551 | #### clonePath 552 | 553 | The path relative to the root of the projects to which this project should be cloned into. This is a unix-style 554 | relative path (i.e. uses forward slashes). The path is invalid if it is absolute or tries to escape the project root 555 | through the usage of '..'. If not specified, defaults to the project name. 556 | 557 | `clonePath` 558 | 559 | - is optional 560 | - type: `string` 561 | 562 | ##### clonePath Type 563 | 564 | `string` 565 | 566 | #### name 567 | 568 | ##### The Project Name 569 | 570 | `name` 571 | 572 | - is **required** 573 | - type: `string` 574 | 575 | ##### name Type 576 | 577 | `string` 578 | 579 | ##### name Example 580 | 581 | ```json 582 | petclinic 583 | ``` 584 | 585 | #### source 586 | 587 | ##### The Project Source object 588 | 589 | Describes the project's source - type and location 590 | 591 | `source` 592 | 593 | - is **required** 594 | - type: `object` 595 | 596 | ##### source Type 597 | 598 | `object` with following properties: 599 | 600 | | Property | Type | Required | 601 | | ------------------- | ------ | ------------ | 602 | | `branch` | string | Optional | 603 | | `commitId` | string | Optional | 604 | | `location` | string | **Required** | 605 | | `sparseCheckoutDir` | string | Optional | 606 | | `startPoint` | string | Optional | 607 | | `tag` | string | Optional | 608 | | `type` | string | **Required** | 609 | 610 | #### branch 611 | 612 | The name of the of the branch to check out after obtaining the source from the location. The branch has to already 613 | exist in the source otherwise the default branch is used. In case of git, this is also the name of the remote branch to 614 | push to. 615 | 616 | `branch` 617 | 618 | - is optional 619 | - type: `string` 620 | 621 | ##### branch Type 622 | 623 | `string` 624 | 625 | ##### branch Examples 626 | 627 | ```json 628 | master 629 | ``` 630 | 631 | ```json 632 | feature - 42 633 | ``` 634 | 635 | #### commitId 636 | 637 | The id of the commit to reset the checked out branch to. Note that this is equivalent to 'startPoint' and provided for 638 | convenience. 639 | 640 | `commitId` 641 | 642 | - is optional 643 | - type: `string` 644 | 645 | ##### commitId Type 646 | 647 | `string` 648 | 649 | ##### commitId Example 650 | 651 | ```json 652 | 349d3ad 653 | ``` 654 | 655 | #### location 656 | 657 | Project's source location address. Should be URL for git and github located projects, or file:// for zip. 658 | 659 | `location` 660 | 661 | - is **required** 662 | - type: `string` 663 | 664 | ##### location Type 665 | 666 | `string` 667 | 668 | ##### location Example 669 | 670 | ```json 671 | git@github.com:spring-projects/spring-petclinic.git 672 | ``` 673 | 674 | #### sparseCheckoutDir 675 | 676 | Part of project to populate in the working directory. 677 | 678 | `sparseCheckoutDir` 679 | 680 | - is optional 681 | - type: `string` 682 | 683 | ##### sparseCheckoutDir Type 684 | 685 | `string` 686 | 687 | ##### sparseCheckoutDir Examples 688 | 689 | ```json 690 | /core/ 691 | ``` 692 | 693 | ```json 694 | core/ 695 | ``` 696 | 697 | ```json 698 | core 699 | ``` 700 | 701 | ```json 702 | /wsmaster/che-core-api-workspace/ 703 | ``` 704 | 705 | ```json 706 | /d* 707 | ``` 708 | 709 | #### startPoint 710 | 711 | The tag or commit id to reset the checked out branch to. 712 | 713 | `startPoint` 714 | 715 | - is optional 716 | - type: `string` 717 | 718 | ##### startPoint Type 719 | 720 | `string` 721 | 722 | ##### startPoint Examples 723 | 724 | ```json 725 | release / 4.2 726 | ``` 727 | 728 | ```json 729 | 349d3ad 730 | ``` 731 | 732 | ```json 733 | v4.2.0 734 | ``` 735 | 736 | #### tag 737 | 738 | The name of the tag to reset the checked out branch to. Note that this is equivalent to 'startPoint' and provided for 739 | convenience. 740 | 741 | `tag` 742 | 743 | - is optional 744 | - type: `string` 745 | 746 | ##### tag Type 747 | 748 | `string` 749 | 750 | ##### tag Example 751 | 752 | ```json 753 | v4.2.0 754 | ``` 755 | 756 | #### type 757 | 758 | Project's source type. 759 | 760 | `type` 761 | 762 | - is **required** 763 | - type: `string` 764 | 765 | ##### type Type 766 | 767 | `string` 768 | 769 | ##### type Examples 770 | 771 | ```json 772 | git 773 | ``` 774 | 775 | ```json 776 | github 777 | ``` 778 | 779 | ```json 780 | zip 781 | ``` 782 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | 2 | ⚠️ v1 of the Devfile is deprecated. Documentation for v2 can be found [here](https://devfile.io). 3 | 4 | ### Introduction 5 | Previously, two kind of recipes were available to bootstrap a cloud developer workspace and to make it portable: [Chefile](https://www.eclipse.org/che/docs/chefile.html) 6 | and [Factories](https://www.eclipse.org/che/docs/factories-getting-started.html#try-a-factory). 7 | As a continuation of this, the brand new `devfile` format was introduced, which combines simplicity and support for high variety of different components available to develop a container based application. 8 | 9 | ### What the devfile consists of 10 | The minimal devfile sufficient to run a workspace from it, consists of the following parts: 11 | - Specification version 12 | - Name 13 | 14 | Without any further configuration a workspace with default editor will be launched along with its default plugins which are configured on Che Server. 15 | By default, `Che Theia` is configured as a default one along with `Che Machine Exec` plugin. 16 | 17 | To get more functional workspace, the following parts can be added: 18 | - A list of components: the development components and user runtimes 19 | - A list of projects: the source code repositories 20 | - A list of commands: actions to manage the workspace components like running the dev tools, starting the runtime environments etc... 21 | 22 | Example of the minimal devfile with project and standard plugins set (Theia editor + exec plugin): 23 | 24 | ``` 25 | 26 | --- 27 | apiVersion: 1.0.0 28 | metadata: 29 | name: petclinic-dev-environment 30 | projects: 31 | - name: petclinic 32 | source: 33 | type: git 34 | location: 'https://github.com/che-samples/web-java-spring-petclinic.git' 35 | components: 36 | - alias: theia-editor 37 | type: cheEditor 38 | id: eclipse/che-theia/next 39 | - alias: exec-plugin 40 | type: chePlugin 41 | id: eclipse/che-machine-exec-plugin/0.0.1 42 | ``` 43 | 44 | For the detailed explanation of all devfile components assignment and possible values, please see the following resources: 45 | - [Specification repository](https://github.com/redhat-developer/devfile) 46 | - [detailed json-schema documentation](https://redhat-developer.github.io/devfile/devfile). 47 | 48 | 49 | ### Getting Started 50 | The simplest way to use devfile is to have it deployed into GitHub source repository and then create factory from this repo. 51 | This is as simple as create `devfile.yaml` file in the root of your GH repo, and then execute the factory: 52 | ``` 53 | https:///f?url=https://github.com/mygroup/myrepo 54 | ``` 55 | 56 | Also, it is possible to execute devfile by constructing the factory with the URL to it's raw content, for example, 57 | ``` 58 | https:///f?url=https://pastebin.com/raw/ux6iCGaW 59 | ``` 60 | or sending a devfile to a dedicated REST API using curl/swagger, which will create new workspace and return it's configuration: 61 | ``` 62 | curl -X POST -H "Authorization: " -H "Content-Type: application/yaml" -d https:///api/devfile 63 | ``` 64 | 65 | If you're a user of `chectl` tool, it is also possible to execute workspace from devfile, using `workspace:start` command 66 | parameter as follows: 67 | ``` 68 | chectl workspace:start --devfile=devfile.yaml 69 | ```` 70 | Please note that currently this way only works for the local (same machine) devfiles - URL can't be used here atm. 71 | 72 | ### Project details 73 | A single devfile can specify several projects. For each project, one has to specify the type of the 74 | source repository, its location and optionally also the directory to which the project should be 75 | cloned to. 76 | 77 | As an example, consider this devfile: 78 | 79 | ```yaml 80 | apiVersion: 1.0.0 81 | metadata: 82 | name: example-devfile 83 | projects: 84 | - name: frontend 85 | source: 86 | type: git 87 | location: https://github.com/acmecorp/frontend.git 88 | - name: backend 89 | clonePath: src/github.com/acmecorp/backend 90 | source: 91 | type: git 92 | location: https://github.com/acmecorp/backend.git 93 | ``` 94 | 95 | In the example above, we see a devfile with 2 projects, `frontend` and `backend`, each located in 96 | its own repository on github. `backend` has a specific requirement to be cloned into the 97 | `src/github.com/acmecorp/backend` directory under the source root (implicitly defined by the Che 98 | runtime) while frontend will be cloned into `frontend` directory under the source root. 99 | 100 | ### Supported component types 101 | There are currently four types of components supported. There is two simpler types, such as `cheEditor` and `chePlugin` and 102 | two more complex - `kubernetes` (or `openshift`) and `dockerimage`. 103 | Please note that all components inside single devfile must have unique names. 104 | Detailed component types explanation below: 105 | 106 | #### cheEditor 107 | Describes the editor which used in workspace by defining its id. 108 | Devfile can only contain one component with `cheEditor` type. 109 | 110 | ``` 111 | ... 112 | components: 113 | - alias: theia-editor 114 | type: cheEditor 115 | id: eclipse/che-theia/next 116 | ``` 117 | 118 | If it is missing then a default editor will be provided along with its default plugins. 119 | The default plugins will be provided also for an explicitly defined editor with the same ID as the default one (even if in a different version). 120 | By default, `Che Theia` is configured as default editor along with `Che Machine Exec` plugin. 121 | You're able to put `editorFree:true` attribute into Devfile attributes in case you do not need any editor in your workspace. 122 | 123 | #### chePlugin 124 | Describes the plugin which used in workspace by defining it's id. 125 | It is allowed to have several `chePlugin` components. 126 | 127 | ``` 128 | ... 129 | components: 130 | - alias: exec-plugin 131 | type: chePlugin 132 | id: eclipse/che-machine-exec-plugin/0.0.1 133 | ``` 134 | 135 | Both types above using id, which is slash-separated publisher, name and version of plugin from Che Plugin registry. 136 | List of available Che plugins and more information about registry can be found on https://github.com/eclipse/che-plugin-registry. 137 | 138 | It is also possible to specify own registry for the cheEditor and chePlugin types, by using 139 | `registryUrl` parameter as follows: 140 | 141 | ``` 142 | ... 143 | components: 144 | - alias: exec-plugin 145 | type: chePlugin 146 | registryUrl: https://my-customregistry.com 147 | id: eclipse/che-machine-exec-plugin/0.0.1 148 | ``` 149 | 150 | As an alternative way of specifying editor or plugin, instead of using plugin id (+ optional registry), 151 | it is possible to provide direct link to the plugin descriptor (typically, named `meta.yaml`) by using 152 | the reference field: 153 | 154 | ``` 155 | ... 156 | components: 157 | - alias: exec-plugin 158 | type: chePlugin 159 | reference: https://raw.githubusercontent.com.../plugin/1.0.1/meta.yaml 160 | ``` 161 | 162 | Please note it's not possible to mix id and reference in single plugin definition, they are mutually exclusive. 163 | 164 | 165 | For each of types above it is also possible to specify container(s) memory limit as follows: 166 | ``` 167 | ... 168 | components: 169 | - alias: exec-plugin 170 | type: chePlugin 171 | id: eclipse/che-machine-exec-plugin/0.0.1 172 | memoryLimit: 256M 173 | ``` 174 | This limit will be applied to each container of given plugin. 175 | 176 | A plugin may need to be precisely tuned and in such case plugin preferences should be used. 177 | Example shows how jvm may be configured with plugin's preferences. 178 | ``` 179 | ... 180 | - 181 | id: redhat/java/0.38.0 182 | type: chePlugin 183 | preferences: 184 | java.jdt.ls.vmargs: '-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication' 185 | ``` 186 | 187 | #### kubernetes/openshift 188 | More complex component type, which allows to apply configuration from kubernetes/openshift lists. Content of the component may be provided either via `reference` attribute which points to the file with component content. 189 | ``` 190 | ... 191 | components: 192 | - alias: mysql 193 | type: kubernetes 194 | reference: petclinic.yaml 195 | selector: 196 | app.kubernetes.io/name: mysql 197 | app.kubernetes.io/component: database 198 | app.kubernetes.io/part-of: petclinic 199 | ``` 200 | Alternatively, if you need to post devfile with such components to REST API, contents of K8S/Openshift list can be embedded into devfile using `referenceContent` field: 201 | 202 | ``` 203 | ... 204 | components: 205 | - alias: mysql 206 | type: kubernetes 207 | reference: petclinic.yaml 208 | referenceContent: | 209 | kind: List 210 | items: 211 | - 212 | apiVersion: v1 213 | kind: Pod 214 | metadata: 215 | name: ws 216 | spec: 217 | containers: 218 | ... etc 219 | ``` 220 | 221 | As with `dockerimage` component described below, it is possible to override the entrypoint of the 222 | containers contained in the Kubernetes/Openshift list using the `command` and `args` properties (as 223 | [understood](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes) 224 | by Kubernetes). Of course, there can be more containers in the list (contained in pods or pod 225 | templates of deployments) and so there needs to be a way of selecting which containers to apply the 226 | entrypoint changes to. 227 | 228 | The entrypoints can be defined for example like this: 229 | 230 | ```yaml 231 | ... 232 | components: 233 | - alias: appDeployment 234 | type: kubernetes 235 | reference: app-deployment.yaml 236 | entrypoints: 237 | - parentName: mysqlServer 238 | command: ['sleep'] 239 | args: ['infinity'] 240 | - parentSelector: 241 | app: prometheus 242 | args: ['-f', '/opt/app/prometheus-config.yaml'] 243 | ``` 244 | 245 | You can see that the `entrypoints` list contains constraints for picking the containers along with 246 | the command/args to apply to them. In the example above, the constraint is `parentName: mysqlServer` 247 | which will cause the command to be applied to all containers defined in any parent object called 248 | `mysqlServer`. The parent object is assumed to be a top level object in the list defined in the 249 | referenced file, e.g. `app-deployment.yaml` in the example above. 250 | 251 | Other types of constraints (and their combinations) are possible: 252 | 253 | * `containerName` - the name of the container 254 | * `parentName` - the name of the parent object that (indirectly) contains the containers to override 255 | * `parentSelector` - the set of labels the parent object needs to have 256 | 257 | Combination of these constraints can be used to precisely locate the containers inside the 258 | referenced Kubernetes list. 259 | 260 | #### dockerimage 261 | Component type which allows to define docker image based configuration of container in workspace. 262 | Devfile can only contain one component with `dockerimage` type. 263 | 264 | ``` 265 | ... 266 | components: 267 | - alias: maven 268 | type: dockerimage 269 | image: eclipe/maven-jdk8:latest 270 | volumes: 271 | - name: mavenrepo 272 | containerPath: /root/.m2 273 | env: 274 | - name: ENV_VAR 275 | value: value 276 | endpoints: 277 | - name: maven-server 278 | port: 3101 279 | attributes: 280 | protocol: http 281 | secure: 'true' 282 | public: 'true' 283 | discoverable: 'false' 284 | memoryLimit: 1536M 285 | command: ['tail'] 286 | args: ['-f', '/dev/null'] 287 | ``` 288 | 289 | ### Commands expanded 290 | Devfile allows to specify commands set to be available for execution in workspace. Each command may contain subset of actions, which are related to specific component, in whose container it will be executed. 291 | 292 | 293 | ``` 294 | ... 295 | commands: 296 | - name: build 297 | actions: 298 | - type: exec 299 | component: mysql 300 | command: mvn clean 301 | workdir: /projects/spring-petclinic 302 | ``` 303 | 304 | ### Devfile attributes 305 | 306 | Devfile attributes may be used to configure some features. 307 | 308 | #### Editor free 309 | If editor is not specified Devfile then default one will be provided. In case when no editor is needed `editorFree` attribute should be used. 310 | Default value is `false` and means that Devfile needs default editor to be provisioned if no one is defined. 311 | Example of Devfile without editor 312 | ```yaml 313 | apiVersion: 1.0.0 314 | metadata: 315 | name: petclinic-dev-environment 316 | components: 317 | - alias: myApp 318 | type: kubernetes 319 | local: my-app.yaml 320 | attributes: 321 | editorFree: true 322 | ``` 323 | 324 | #### Ephemeral mode 325 | By default volumes and PVCs specified in Devfile are bound to host folder to persist data even after container restart. 326 | Sometimes it may be needed to disable data persistence for some reasons, like when volume backend is incredibly slow and it is needed to make workspace faster. 327 | To achieve it the `persistVolumes` devfile attribute should be used. Default value is `true`, and in case of `false` `emptyDir` volumes will be used for configured volumes and PVC. 328 | Example of Devfile with ephemeral mode enabled 329 | ```yaml 330 | apiVersion: 1.0.0 331 | metadata: 332 | name: petclinic-dev-environment 333 | projects: 334 | - name: petclinic 335 | source: 336 | type: git 337 | location: 'https://github.com/che-samples/web-java-spring-petclinic.git' 338 | attributes: 339 | persistVolumes: false 340 | ``` 341 | 342 | ### Live working examples 343 | 344 | - [NodeJS simple "Hello World" example](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/samples/web-nodejs-sample/devfile.yaml) 345 | - [NodeJS Application with Mongo DB example](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/samples/web-nodejs-with-db-sample/devfile.yaml) 346 | - [Java Spring-Petclinic example](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/samples/web-java-spring-petclinic/devfile.yaml) 347 | - [Theia frontend plugin example](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/samples/theia-hello-world-frontend-plugin/devfile.yaml) 348 | -------------------------------------------------------------------------------- /docs/updateSchema.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #set -x 4 | 5 | if [ -z "${1}" ]; then 6 | echo "use script like this: 'sh updateSchema.sh [path_to_devfile.json]'" 7 | exit 1 8 | fi 9 | 10 | if [ ! -f "${1}" ]; then 11 | echo "File '${1}' does not exist." 12 | exit 1 13 | fi 14 | 15 | if [ ! -x "$( command -v docker )" ]; then 16 | echo 'Docker not found. Install to run this script.' 17 | exit 1 18 | fi 19 | 20 | DEVFILE_JSON=$1 21 | REPO_DIR=$( dirname "${0}" ) 22 | REPO_DIR=$( realpath "${REPO_DIR}") 23 | 24 | docker run -it --rm \ 25 | -v "${DEVFILE_JSON}":/home/node/devfile.json:Z \ 26 | -v "${REPO_DIR}":/home/node/devfile:Z \ 27 | node:8 /bin/bash -c \ 28 | "npm install -g @adobe/jsonschema2md@3.3.1; jsonschema2md -d /home/node/devfile.json -o /home/node/devfile;" 29 | -------------------------------------------------------------------------------- /getting-started/angular/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/angular/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/angular/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: angular 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: angular-realworld-example-app 10 | source: 11 | type: git 12 | location: "https://github.com/gothinkster/angular-realworld-example-app" 13 | components: 14 | - 15 | type: chePlugin 16 | id: che-incubator/typescript/latest 17 | - 18 | type: dockerimage 19 | alias: nodejs 20 | image: quay.io/eclipse/che-nodejs10-community:nightly 21 | memoryLimit: 1Gi 22 | endpoints: 23 | - name: 'angular' 24 | port: 4200 25 | mountSources: true 26 | commands: 27 | - name: yarn install 28 | actions: 29 | - type: exec 30 | component: nodejs 31 | command: yarn install 32 | workdir: ${CHE_PROJECTS_ROOT}/angular-realworld-example-app 33 | - 34 | name: build 35 | actions: 36 | - type: exec 37 | component: nodejs 38 | command: yarn run build 39 | workdir: ${CHE_PROJECTS_ROOT}/angular-realworld-example-app 40 | - 41 | name: start 42 | actions: 43 | - type: exec 44 | component: nodejs 45 | command: yarn run start --host 0.0.0.0 --disableHostCheck true 46 | workdir: ${CHE_PROJECTS_ROOT}/angular-realworld-example-app 47 | - 48 | name: lint 49 | actions: 50 | - type: exec 51 | component: nodejs 52 | command: yarn run lint 53 | workdir: ${CHE_PROJECTS_ROOT}/angular-realworld-example-app 54 | -------------------------------------------------------------------------------- /getting-started/go/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/go/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/go/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: golang 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: example 10 | source: 11 | type: git 12 | location: https://github.com/golang/example.git 13 | clonePath: src/github.com/golang/example/ 14 | components: 15 | - 16 | type: chePlugin 17 | id: ms-vscode/go/latest 18 | alias: go-plugin 19 | memoryLimit: 512Mi 20 | - 21 | type: dockerimage 22 | # this version is used in the plugin 23 | image: quay.io/eclipse/che-golang-1.10:nightly 24 | alias: go-cli 25 | env: 26 | - name: GOPATH 27 | # replicate the GOPATH from the plugin 28 | value: /go:$(CHE_PROJECTS_ROOT) 29 | - name: GOCACHE 30 | # replicate the GOCACHE from the plugin, even though the cache is not shared 31 | # between the two 32 | value: /tmp/.cache 33 | endpoints: 34 | - name: '8080/tcp' 35 | port: 8080 36 | memoryLimit: 512Mi 37 | mountSources: true 38 | commands: 39 | - 40 | name: run outyet 41 | actions: 42 | - type: exec 43 | component: go-cli 44 | command: go get -d && go run main.go 45 | workdir: ${CHE_PROJECTS_ROOT}/src/github.com/golang/example/outyet 46 | - 47 | name: stop outyet 48 | actions: 49 | - type: exec 50 | component: go-cli 51 | command: kill $(pidof go) 52 | - 53 | name: test outyet 54 | actions: 55 | - type: exec 56 | component: go-cli 57 | command: go test 58 | workdir: ${CHE_PROJECTS_ROOT}/src/github.com/golang/example/outyet 59 | - 60 | name: Debug current file 61 | actions: 62 | - type: vscode-launch 63 | referenceContent: | 64 | { 65 | "version": "0.2.0", 66 | "configurations": [ 67 | { 68 | "name": "Debug current file", 69 | "type": "go", 70 | "request": "launch", 71 | "mode": "auto", 72 | "program": "${fileDirname}", 73 | }, 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /getting-started/java-gradle/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/java-gradle/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/java-gradle/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: java-gradle 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: console-java-simple 10 | source: 11 | type: git 12 | location: "https://github.com/che-samples/console-java-simple.git" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/java/latest 17 | - 18 | type: dockerimage 19 | alias: gradle 20 | image: quay.io/eclipse/che-java11-gradle:nightly 21 | env: 22 | - name: GRADLE_USER_HOME 23 | value: /home/gradle/.gradle 24 | - name: JAVA_OPTS 25 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 26 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 27 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 28 | - name: JAVA_TOOL_OPTIONS 29 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 30 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 31 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 32 | - name: HOME 33 | value: /home/gradle 34 | memoryLimit: 512Mi 35 | endpoints: 36 | - name: '8080/tcp' 37 | port: 8080 38 | volumes: 39 | - name: gradle 40 | containerPath: /home/gradle/.gradle 41 | mountSources: true 42 | commands: 43 | - 44 | name: gradle build 45 | actions: 46 | - 47 | type: exec 48 | component: gradle 49 | command: "gradle build" 50 | workdir: ${CHE_PROJECTS_ROOT}/console-java-simple 51 | - 52 | name: gradle run 53 | actions: 54 | - 55 | type: exec 56 | component: gradle 57 | command: "gradle run" 58 | workdir: ${CHE_PROJECTS_ROOT}/console-java-simple 59 | -------------------------------------------------------------------------------- /getting-started/java-maven/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/java-maven/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/java-maven/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: java-maven 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: console-java-simple 10 | source: 11 | type: git 12 | location: "https://github.com/che-samples/console-java-simple.git" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/java/latest 17 | - 18 | type: dockerimage 19 | alias: maven 20 | image: quay.io/eclipse/che-java11-maven:nightly 21 | env: 22 | - name: MAVEN_CONFIG 23 | value: /home/user/.m2 24 | - name: MAVEN_OPTS 25 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 26 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 27 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 28 | -Duser.home=/home/user" 29 | - name: JAVA_OPTS 30 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 31 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 32 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 33 | - name: JAVA_TOOL_OPTIONS 34 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 35 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 36 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 37 | memoryLimit: 512Mi 38 | endpoints: 39 | - name: '8080/tcp' 40 | port: 8080 41 | mountSources: true 42 | volumes: 43 | - name: m2 44 | containerPath: /home/user/.m2 45 | commands: 46 | - 47 | name: maven build 48 | actions: 49 | - 50 | type: exec 51 | component: maven 52 | command: "mvn clean install" 53 | workdir: ${CHE_PROJECTS_ROOT}/console-java-simple 54 | - 55 | name: maven build and run 56 | actions: 57 | - 58 | type: exec 59 | component: maven 60 | command: "mvn clean install && java -jar ./target/*.jar" 61 | workdir: ${CHE_PROJECTS_ROOT}/console-java-simple 62 | -------------------------------------------------------------------------------- /getting-started/nodejs/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/nodejs/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/nodejs/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: nodejs 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: nodejs-web-app 10 | source: 11 | type: git 12 | location: "https://github.com/che-samples/web-nodejs-sample.git" 13 | components: 14 | - 15 | type: chePlugin 16 | id: che-incubator/typescript/latest 17 | memoryLimit: 512Mi 18 | - 19 | type: dockerimage 20 | alias: nodejs 21 | image: quay.io/eclipse/che-nodejs10-ubi:nightly 22 | memoryLimit: 512Mi 23 | endpoints: 24 | - name: 'nodejs' 25 | port: 3000 26 | mountSources: true 27 | commands: 28 | - 29 | name: download dependencies 30 | actions: 31 | - type: exec 32 | component: nodejs 33 | command: npm install 34 | workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app 35 | - 36 | name: run the web app 37 | actions: 38 | - type: exec 39 | component: nodejs 40 | command: nodemon app.js 41 | workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app 42 | - 43 | name: run the web app (debugging enabled) 44 | actions: 45 | - type: exec 46 | component: nodejs 47 | command: nodemon --inspect app.js 48 | workdir: ${CHE_PROJECTS_ROOT}/nodejs-web-app/app 49 | - 50 | name: stop the web app 51 | actions: 52 | - type: exec 53 | component: nodejs 54 | command: >- 55 | node_server_pids=$(pgrep -fx '.*nodemon (--inspect )?app.js' | tr "\\n" " ") && 56 | echo "Stopping node server with PIDs: ${node_server_pids}" && 57 | kill -15 ${node_server_pids} &>/dev/null && echo 'Done.' 58 | - 59 | name: Attach remote debugger 60 | actions: 61 | - type: vscode-launch 62 | referenceContent: | 63 | { 64 | "version": "0.2.0", 65 | "configurations": [ 66 | { 67 | "type": "node", 68 | "request": "attach", 69 | "name": "Attach to Remote", 70 | "address": "localhost", 71 | "port": 9229, 72 | "localRoot": "${workspaceFolder}", 73 | "remoteRoot": "#{workspaceFolder}" 74 | } 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /getting-started/php/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/php/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/php/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: php-web-simple 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: php-web-simple 10 | source: 11 | type: git 12 | location: "https://github.com/che-samples/web-php-simple" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/php/latest 17 | memoryLimit: 1Gi 18 | - 19 | type: chePlugin 20 | id: redhat/php-debugger/latest 21 | memoryLimit: 256Mi 22 | - 23 | type: dockerimage 24 | alias: php 25 | image: quay.io/eclipse/che-php-7:nightly 26 | memoryLimit: 512Mi 27 | endpoints: 28 | - name: '8080/tcp' 29 | port: 8080 30 | mountSources: true 31 | volumes: 32 | - name: composer 33 | containerPath: "/home/user/.composer" 34 | - name: symfony 35 | containerPath: "/home/user/.symfony" 36 | commands: 37 | - 38 | name: Start Apache Web Server 39 | actions: 40 | - type: exec 41 | component: php 42 | command: "service apache2 start" 43 | - 44 | name: Stop Apache Web Server 45 | actions: 46 | - type: exec 47 | component: php 48 | command: "service apache2 stop" 49 | - 50 | name: Restart Apache Web Server 51 | actions: 52 | - type: exec 53 | component: php 54 | command: "service apache2 restart" 55 | -------------------------------------------------------------------------------- /getting-started/quarkus/README.md: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/quarkus/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/quarkus/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | generateName: quarkus- 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: quarkus-quickstarts 10 | source: 11 | type: git 12 | location: "https://github.com/quarkusio/quarkus-quickstarts.git" 13 | sparseCheckoutDir: getting-started 14 | components: 15 | - 16 | type: chePlugin 17 | id: redhat/quarkus-java11/latest 18 | - 19 | type: dockerimage 20 | alias: centos-quarkus-maven 21 | image: quay.io/eclipse/che-quarkus:nightly 22 | env: 23 | - name: JAVA_OPTS 24 | value: "-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 25 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 26 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 27 | -Duser.home=/home/user" 28 | - name: MAVEN_OPTS 29 | value: $(JAVA_OPTS) 30 | memoryLimit: 4927M 31 | mountSources: true 32 | volumes: 33 | - name: m2 34 | containerPath: /home/user/.m2 35 | endpoints: 36 | - name: 'hello-greeting-endpoint' 37 | port: 8080 38 | attributes: 39 | path: /hello/greeting/che-user 40 | 41 | - type: dockerimage 42 | alias: ubi-minimal 43 | image: 'registry.access.redhat.com/ubi8/ubi-minimal' 44 | memoryLimit: 32M 45 | mountSources: true 46 | endpoints: 47 | - name: 'hello-greeting-endpoint' 48 | port: 8080 49 | attributes: 50 | path: /hello/greeting/che-user 51 | command: ['tail'] 52 | args: ['-f', '/dev/null'] 53 | 54 | commands: 55 | - 56 | name: Package 57 | actions: 58 | - 59 | type: exec 60 | component: centos-quarkus-maven 61 | command: "./mvnw package" 62 | workdir: ${CHE_PROJECTS_ROOT}/quarkus-quickstarts/getting-started 63 | - 64 | name: Start Development mode (Hot reload + debug) 65 | actions: 66 | - 67 | type: exec 68 | component: centos-quarkus-maven 69 | command: "./mvnw compile quarkus:dev" 70 | workdir: ${CHE_PROJECTS_ROOT}/quarkus-quickstarts/getting-started 71 | - 72 | name: Package Native 73 | actions: 74 | - 75 | type: exec 76 | component: centos-quarkus-maven 77 | command: "./mvnw package -Dnative -Dmaven.test.skip" 78 | workdir: ${CHE_PROJECTS_ROOT}/quarkus-quickstarts/getting-started 79 | 80 | - 81 | name: Start Native 82 | actions: 83 | - 84 | type: exec 85 | component: ubi-minimal 86 | command: ./getting-started-1.0-SNAPSHOT-runner 87 | workdir: ${CHE_PROJECTS_ROOT}/quarkus-quickstarts/getting-started/target 88 | - 89 | name: Attach remote debugger 90 | actions: 91 | - type: vscode-launch 92 | referenceContent: | 93 | { 94 | "version": "0.2.0", 95 | "configurations": [ 96 | { 97 | "type": "java", 98 | "request": "attach", 99 | "name": "Attach to Remote Quarkus App", 100 | "hostName": "localhost", 101 | "port": 5005 102 | } 103 | ] 104 | } 105 | -------------------------------------------------------------------------------- /getting-started/spring-boot/README.md: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/spring-boot/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/spring-boot/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: web-java-spring-boot 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: web-java-spring-boot 10 | source: 11 | type: git 12 | location: "https://github.com/che-samples/web-java-spring-boot.git" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/java/latest 17 | memoryLimit: 1512Mi 18 | - 19 | type: dockerimage 20 | alias: tools 21 | image: quay.io/eclipse/che-java8-maven:nightly 22 | env: 23 | - name: MAVEN_CONFIG 24 | value: "" 25 | - name: JAVA_OPTS 26 | value: "-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 27 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 28 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 29 | -Duser.home=/home/user" 30 | - name: MAVEN_OPTS 31 | value: $(JAVA_OPTS) 32 | memoryLimit: 768Mi 33 | endpoints: 34 | - name: '8080/tcp' 35 | port: 8080 36 | mountSources: true 37 | volumes: 38 | - name: m2 39 | containerPath: /home/user/.m2 40 | commands: 41 | - 42 | name: maven build 43 | actions: 44 | - 45 | type: exec 46 | component: tools 47 | command: "mvn clean install" 48 | workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-boot 49 | - name: run webapp 50 | actions: 51 | - 52 | type: exec 53 | component: tools 54 | command: "mvn spring-boot:run" 55 | workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-boot 56 | - name: stop webapp 57 | actions: 58 | - 59 | type: exec 60 | component: tools 61 | command: "echo 'Stopping the application...' && kill $(pidof java) && echo 'The application has been successfully stopped'" 62 | - name: run webapp (debug mode) 63 | actions: 64 | - 65 | type: exec 66 | component: tools 67 | command: | 68 | java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \ 69 | target/*.jar 70 | workdir: ${CHE_PROJECTS_ROOT}/web-java-spring-boot 71 | - name: Debug remote java application 72 | actions: 73 | - type: vscode-launch 74 | referenceContent: | 75 | { 76 | "version": "0.2.0", 77 | "configurations": [ 78 | { 79 | "type": "java", 80 | "name": "Debug (Attach) - Remote", 81 | "request": "attach", 82 | "hostName": "localhost", 83 | "port": 5005 84 | }] 85 | } 86 | -------------------------------------------------------------------------------- /getting-started/spring-petclinic/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/spring-petclinic/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/spring-petclinic/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: java-web-spring 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: java-web-spring 10 | source: 11 | type: git 12 | location: "https://github.com/spring-projects/spring-petclinic.git" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/java/latest 17 | memoryLimit: 1512Mi 18 | - 19 | type: dockerimage 20 | alias: tools 21 | image: quay.io/eclipse/che-java8-maven:nightly 22 | env: 23 | - name: MAVEN_CONFIG 24 | value: "" 25 | - name: JAVA_OPTS 26 | value: "-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 27 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 28 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 29 | -Duser.home=/home/user" 30 | - name: MAVEN_OPTS 31 | value: $(JAVA_OPTS) 32 | memoryLimit: 768Mi 33 | endpoints: 34 | - name: '8080/tcp' 35 | port: 8080 36 | mountSources: true 37 | volumes: 38 | - name: m2 39 | containerPath: /home/user/.m2 40 | commands: 41 | - 42 | name: maven build 43 | actions: 44 | - 45 | type: exec 46 | component: tools 47 | command: "mvn clean install" 48 | workdir: ${CHE_PROJECTS_ROOT}/java-web-spring 49 | - name: run webapp 50 | actions: 51 | - 52 | type: exec 53 | component: tools 54 | command: | 55 | java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \ 56 | target/*.jar 57 | workdir: ${CHE_PROJECTS_ROOT}/java-web-spring 58 | - 59 | name: stop webapp 60 | actions: 61 | - 62 | type: exec 63 | component: tools 64 | command: "echo 'Stopping the application...' && kill $(pidof java) && echo 'The application has been successfully stopped'" 65 | - name: Debug remote java application 66 | actions: 67 | - type: vscode-launch 68 | referenceContent: | 69 | { 70 | "version": "0.2.0", 71 | "configurations": [ 72 | { 73 | "type": "java", 74 | "name": "Debug (Attach) - Remote", 75 | "request": "attach", 76 | "hostName": "localhost", 77 | "port": 5005 78 | }] 79 | } 80 | -------------------------------------------------------------------------------- /getting-started/spring-rest-guide/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/spring-rest-guide/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/spring-rest-guide/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: spring-rest-guide 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: spring-rest-guide 10 | source: 11 | type: git 12 | location: "https://github.com/spring-guides/gs-rest-service.git" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/java/latest 17 | memoryLimit: 1512Mi 18 | - 19 | type: dockerimage 20 | alias: tools 21 | image: quay.io/eclipse/che-java8-maven:nightly 22 | env: 23 | - name: MAVEN_CONFIG 24 | value: "" 25 | - name: JAVA_OPTS 26 | value: "-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 27 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 28 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 29 | -Duser.home=/home/user" 30 | - name: MAVEN_OPTS 31 | value: $(JAVA_OPTS) 32 | memoryLimit: 768Mi 33 | endpoints: 34 | - name: '8080/tcp' 35 | port: 8080 36 | mountSources: true 37 | volumes: 38 | - name: m2 39 | containerPath: /home/user/.m2 40 | commands: 41 | - 42 | name: maven build 43 | actions: 44 | - 45 | type: exec 46 | component: tools 47 | command: "mvn clean install" 48 | workdir: ${CHE_PROJECTS_ROOT}/spring-rest-guide/complete 49 | - name: run webapp 50 | actions: 51 | - 52 | type: exec 53 | component: tools 54 | command: "mvn spring-boot:run" 55 | workdir: ${CHE_PROJECTS_ROOT}/spring-rest-guide/complete 56 | - name: stop webapp 57 | actions: 58 | - 59 | type: exec 60 | component: tools 61 | command: "echo 'Stopping the application...' && kill $(pidof java) && echo 'The application has been successfully stopped'" 62 | - name: run webapp (debug mode) 63 | actions: 64 | - 65 | type: exec 66 | component: tools 67 | command: | 68 | java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \ 69 | target/*.jar 70 | workdir: ${CHE_PROJECTS_ROOT}/spring-rest-guide/complete 71 | - name: Debug remote java application 72 | actions: 73 | - type: vscode-launch 74 | referenceContent: | 75 | { 76 | "version": "0.2.0", 77 | "configurations": [ 78 | { 79 | "type": "java", 80 | "name": "Debug (Attach) - Remote", 81 | "request": "attach", 82 | "hostName": "localhost", 83 | "port": 5005 84 | }] 85 | } 86 | -------------------------------------------------------------------------------- /getting-started/thorntail/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/thorntail/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/thorntail/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: thorntail-rest-http 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: thorntail-rest-http 10 | source: 11 | type: git 12 | location: "https://github.com/thorntail-examples/rest-http" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/java/latest 17 | - 18 | type: dockerimage 19 | alias: maven 20 | image: quay.io/eclipse/che-java11-maven:nightly 21 | env: 22 | - name: MAVEN_CONFIG 23 | value: "" 24 | - name: MAVEN_OPTS 25 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 26 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 27 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 28 | -Duser.home=/home/user" 29 | - name: JAVA_OPTS 30 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 31 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 32 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 33 | - name: JAVA_TOOL_OPTIONS 34 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 35 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 36 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 37 | memoryLimit: 512Mi 38 | endpoints: 39 | - name: '8080/tcp' 40 | port: 8080 41 | mountSources: true 42 | volumes: 43 | - name: m2 44 | containerPath: /home/user/.m2 45 | commands: 46 | - 47 | name: build 48 | actions: 49 | - 50 | type: exec 51 | component: maven 52 | command: "mvn clean install -DskipTests=true" 53 | workdir: ${CHE_PROJECTS_ROOT}/thorntail-rest-http 54 | - 55 | name: build and run 56 | actions: 57 | - 58 | type: exec 59 | component: maven 60 | command: "mvn clean install -DskipTests=true && java -jar target/*-thorntail.jar" 61 | workdir: ${CHE_PROJECTS_ROOT}/thorntail-rest-http 62 | - 63 | name: build and run (debugging enabled) 64 | actions: 65 | - 66 | type: exec 67 | component: maven 68 | command: | 69 | mvn clean install -DskipTests=true && \ 70 | java -jar \ 71 | -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5005 \ 72 | target/*-thorntail.jar 73 | workdir: ${CHE_PROJECTS_ROOT}/thorntail-rest-http 74 | - 75 | name: stop 76 | actions: 77 | - 78 | type: exec 79 | component: maven 80 | command: "echo 'Stopping the application...' && kill $(pidof java) && echo 'The application has been successfully stopped'" 81 | - 82 | name: Debug remote java application 83 | actions: 84 | - type: vscode-launch 85 | referenceContent: | 86 | { 87 | "version": "0.2.0", 88 | "configurations": [ 89 | { 90 | "type": "java", 91 | "name": "Debug (Attach) - Remote", 92 | "request": "attach", 93 | "hostName": "localhost", 94 | "port": 5005 95 | }] 96 | } 97 | -------------------------------------------------------------------------------- /getting-started/vaadin-addressbook/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/factory-contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/vaadin-addressbook/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/vaadin-addressbook/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: vaadin-addressbook 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - name: addressbook 9 | source: 10 | type: git 11 | location: 'https://github.com/vaadin/addressbook.git' 12 | components: 13 | - 14 | type: chePlugin 15 | id: redhat/java/latest 16 | - 17 | type: dockerimage 18 | alias: maven 19 | image: quay.io/eclipse/che-java11-maven:nightly 20 | env: 21 | - name: MAVEN_CONFIG 22 | value: "" 23 | - name: MAVEN_OPTS 24 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 25 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 26 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 27 | -Duser.home=/home/user" 28 | - name: JAVA_OPTS 29 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 30 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 31 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 32 | - name: JAVA_TOOL_OPTIONS 33 | value: "-XX:MaxRAMPercentage=50 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 34 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 35 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom" 36 | memoryLimit: 512Mi 37 | endpoints: 38 | - name: '8080/tcp' 39 | port: 8080 40 | mountSources: true 41 | volumes: 42 | - name: m2 43 | containerPath: /home/user/.m2 44 | commands: 45 | - name: run 46 | actions: 47 | - type: exec 48 | component: maven 49 | command: "mvn -f ${CHE_PROJECTS_ROOT}/addressbook jetty:run" 50 | - name: stop 51 | actions: 52 | - type: exec 53 | component: maven 54 | command: "echo 'Stopping the application...' && kill $(pidof java) && echo 'The application has been successfully stopped'" 55 | -------------------------------------------------------------------------------- /getting-started/vertx/README.MD: -------------------------------------------------------------------------------- 1 | [![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/getting-started/vertx/devfile.yaml) 2 | -------------------------------------------------------------------------------- /getting-started/vertx/devfile.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: 1.0.0 3 | metadata: 4 | name: java-web-vertx 5 | attributes: 6 | persistVolumes: 'false' 7 | projects: 8 | - 9 | name: vertx-http-example 10 | source: 11 | type: git 12 | location: "https://github.com/openshift-vertx-examples/vertx-http-example.git" 13 | components: 14 | - 15 | type: chePlugin 16 | id: redhat/java/latest 17 | - 18 | type: dockerimage 19 | alias: maven 20 | image: quay.io/eclipse/che-java8-maven:nightly 21 | env: 22 | - name: MAVEN_CONFIG 23 | value: "" 24 | - name: JAVA_OPTS 25 | value: "-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 26 | -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 27 | -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom 28 | -Duser.home=/home/user" 29 | - name: MAVEN_OPTS 30 | value: $(JAVA_OPTS) 31 | memoryLimit: 512Mi 32 | endpoints: 33 | - name: '8080/tcp' 34 | port: 8080 35 | mountSources: true 36 | volumes: 37 | - name: m2 38 | containerPath: /home/user/.m2 39 | commands: 40 | - 41 | name: maven build 42 | actions: 43 | - 44 | type: exec 45 | component: maven 46 | command: "mvn -Duser.home=${HOME} clean install" 47 | workdir: "${CHE_PROJECTS_ROOT}/vertx-http-example" 48 | - 49 | name: run app 50 | actions: 51 | - 52 | type: exec 53 | component: maven 54 | command: | 55 | JDBC_URL=jdbc:h2:/tmp/db \ 56 | java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \ 57 | ./target/*.jar 58 | workdir: "${CHE_PROJECTS_ROOT}/vertx-http-example" 59 | - 60 | name: stop app 61 | actions: 62 | - 63 | type: exec 64 | component: maven 65 | command: "echo 'Stopping the application...' && kill $(pidof java) && echo 'The application has been successfully stopped'" 66 | - name: Debug remote java application 67 | actions: 68 | - type: vscode-launch 69 | referenceContent: | 70 | { 71 | "version": "0.2.0", 72 | "configurations": [ 73 | { 74 | "type": "java", 75 | "name": "Debug (Attach) - Remote", 76 | "request": "attach", 77 | "hostName": "localhost", 78 | "port": 5005 79 | }] 80 | } 81 | -------------------------------------------------------------------------------- /petclinic.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: List 3 | items: 4 | - apiVersion: v1 5 | kind: Pod 6 | metadata: 7 | name: petclinic 8 | labels: 9 | app.kubernetes.io/name: petclinic 10 | app.kubernetes.io/component: webapp 11 | app.kubernetes.io/part-of: petclinic 12 | spec: 13 | containers: 14 | - name: server 15 | image: mariolet/petclinic 16 | ports: 17 | - containerPort: 8080 18 | protocol: TCP 19 | resources: 20 | limits: 21 | memory: 512Mi 22 | - apiVersion: v1 23 | kind: Pod 24 | metadata: 25 | name: petclinic 26 | labels: 27 | app.kubernetes.io/name: mysql 28 | app.kubernetes.io/component: database 29 | app.kubernetes.io/part-of: petclinic 30 | spec: 31 | containers: 32 | - name: mysql 33 | image: centos/mysql-57-centos7 34 | env: 35 | - name: MYSQL_USER 36 | value: petclinic 37 | - name: MYSQL_PASSWORD 38 | value: petclinic 39 | - name: MYSQL_ROOT_PASSWORD 40 | value: petclinic 41 | - name: MYSQL_DATABASE 42 | value: petclinic 43 | ports: 44 | - containerPort: 3306 45 | protocol: TCP 46 | resources: 47 | limits: 48 | memory: 512Mi 49 | - kind: Service 50 | apiVersion: v1 51 | metadata: 52 | name: mysql 53 | labels: 54 | app.kubernetes.io/name: mysql 55 | app.kubernetes.io/component: database 56 | app.kubernetes.io/part-of: petclinic 57 | spec: 58 | ports: 59 | - name: mysql 60 | port: 3306 61 | targetPort: 3360 62 | selector: 63 | app.kubernetes.io/name: mysql 64 | app.kubernetes.io/component: database 65 | app.kubernetes.io/part-of: petclinic 66 | - kind: Service 67 | apiVersion: v1 68 | metadata: 69 | name: petclinic 70 | labels: 71 | app.kubernetes.io/name: petclinic 72 | app.kubernetes.io/component: webapp 73 | app.kubernetes.io/part-of: petclinic 74 | spec: 75 | ports: 76 | - name: web 77 | port: 8080 78 | targetPort: 8080 79 | selector: 80 | app: petclinic 81 | component: webapp 82 | - kind: Route 83 | apiVersion: v1 84 | metadata: 85 | name: petclinic 86 | labels: 87 | app.kubernetes.io/name: petclinic 88 | app.kubernetes.io/component: webapp 89 | app.kubernetes.io/part-of: petclinic 90 | spec: 91 | to: 92 | kind: Service 93 | name: petclinic 94 | port: 95 | targetPort: web 96 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | This folder contains a list of samples devfiles for Eclipse Che workspaces. 2 | 3 | You can use them to start a Che workspace: 4 | 5 | - With a Che Factory: 6 | ``` 7 | https:///f?url=https://raw.githubusercontent.com/redhat-developer/devfile/master/samples//devfile.yaml 8 | ``` 9 | 10 | - With cURL (Requires clone the repo) : 11 | ``` 12 | curl -X POST -H "Authorization: " -H "Content-Type: application/yaml" -d "data=@path/to/devfile.yaml" https:///api/devfile 13 | ``` 14 | 15 | - With [chectl](https://github.com/che-incubator/chectl/) (Requires clone the repo): 16 | ``` 17 | chectl workspace:start --devfile=path/to/devfile.yaml 18 | ``` -------------------------------------------------------------------------------- /samples/theia-hello-world-frontend-plugin/dev.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: List 3 | items: 4 | - apiVersion: v1 5 | kind: Pod 6 | metadata: 7 | name: ws 8 | spec: 9 | containers: 10 | - name: theia-dev 11 | image: eclipse/che-theia-dev:nightly 12 | resources: 13 | limits: 14 | memory: 2048Mi 15 | volumeMounts: 16 | - mountPath: /projects 17 | name: projects 18 | volumes: 19 | - name: projects 20 | persistentVolumeClaim: 21 | claimName: projects 22 | - apiVersion: v1 23 | kind: PersistentVolumeClaim 24 | metadata: 25 | name: projects 26 | spec: 27 | accessModes: 28 | - ReadWriteOnce 29 | resources: 30 | requests: 31 | storage: 2Gi 32 | -------------------------------------------------------------------------------- /samples/theia-hello-world-frontend-plugin/devfile.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1.0.0 2 | metadata: 3 | name: theia-hello-world-plugin 4 | projects: 5 | - name: che-theia-samples 6 | source: 7 | type: git 8 | location: 'https://github.com/eclipse/che-theia-samples.git' 9 | components: 10 | - alias: theia-editor 11 | type: cheEditor 12 | id: org.eclipse.che.editor.theia:latest 13 | - alias: theia-dev 14 | type: kubernetes 15 | reference: dev.yaml 16 | commands: 17 | - name: build 18 | actions: 19 | - type: exec 20 | component: theia-dev 21 | command: cd ${CHE_PROJECTS_ROOT}/che-theia-samples/samples/hello-world-frontend-plugin && yarn 22 | - name: run 23 | actions: 24 | - type: exec 25 | component: theia-editor 26 | command: export HOSTED_PLUGIN=${CHE_PROJECTS_ROOT}/che-theia-samples/samples/hello-world-frontend-plugin && node ${HOME}/src-gen/backend/main.js ${CHE_PROJECTS_ROOT} --hostname=0.0.0.0 --port=3130 && yarn start 27 | -------------------------------------------------------------------------------- /samples/web-java-spring-petclinic/devfile.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1.0.0 2 | metadata: 3 | name: spring-petclinic 4 | projects: 5 | - name: spring-petclinic 6 | source: 7 | type: git 8 | location: 'https://github.com/che-samples/web-java-spring-petclinic.git' 9 | components: 10 | - alias: dev 11 | type: dockerimage 12 | image: registry.devshift.net/che/centos_jdk8 13 | mountSources: true 14 | endpoints: 15 | - name: petclinic-web-server 16 | port: 8080 17 | attributes: 18 | protocol: http 19 | secure: 'false' 20 | public: 'true' 21 | discoverable: 'false' 22 | memoryLimit: 2048M 23 | commands: 24 | - name: build_&_run 25 | actions: 26 | - type: exec 27 | component: dev 28 | command: "cd $CHE_PROJECTS_ROOT/spring-petclinic && mvn clean install && cp $CHE_PROJECTS_ROOT/spring-petclinic/target/*.war $TOMCAT_HOME/webapps/ROOT.war && $TOMCAT_HOME/bin/catalina.sh run 2>&1" 29 | - name: stop 30 | actions: 31 | - type: exec 32 | component: dev 33 | command: "$TOMCAT_HOME/bin/catalina.sh stop 2>&1" 34 | -------------------------------------------------------------------------------- /samples/web-nodejs-sample/devfile.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1.0.0 2 | metadata: 3 | name: nodejs-sample 4 | projects: 5 | - name: nodejs-sample 6 | source: 7 | type: git 8 | location: 'https://github.com/che-samples/web-nodejs-sample.git' 9 | components: 10 | - alias: theia-editor 11 | type: cheEditor 12 | id: org.eclipse.che.editor.theia:latest 13 | commands: 14 | - name: start 15 | actions: 16 | - type: exec 17 | component: theia-editor 18 | command: cd ${CHE_PROJECTS_ROOT}/nodejs-sample/app && node app.js 19 | - name: test 20 | actions: 21 | - type: exec 22 | component: theia-editor 23 | command: curl localhost:3000 24 | -------------------------------------------------------------------------------- /samples/web-nodejs-with-db-sample/devfile.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: 1.0.0 2 | metadata: 3 | name: nodejs-with-db 4 | projects: 5 | - name: nodejs-mongo-app 6 | source: 7 | type: git 8 | location: 'https://github.com/ijason/NodeJS-Sample-App.git' 9 | commitId: 187d468 # refers to the last commitId the project compiles (with express3) 10 | components: 11 | - type: kubernetes 12 | reference: mongo-db.yaml 13 | - alias: nodejs-app 14 | type: openshift 15 | reference: nodejs-app.yaml 16 | commands: 17 | - name: run 18 | actions: 19 | - type: exec 20 | component: nodejs-app 21 | command: cd ${CHE_PROJECTS_ROOT}/nodejs-mongo-app/EmployeeDB/ && npm install && sed -i -- ''s/localhost/mongo/g'' app.js && node app.js 22 | -------------------------------------------------------------------------------- /samples/web-nodejs-with-db-sample/mongo-db.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: List 4 | items: 5 | - 6 | apiVersion: apps/v1 7 | kind: Deployment 8 | metadata: 9 | labels: 10 | name: mongo 11 | name: mongo-controller 12 | spec: 13 | selector: 14 | matchLabels: 15 | name: mongo 16 | template: 17 | metadata: 18 | labels: 19 | name: mongo 20 | name: mongo-controller 21 | spec: 22 | containers: 23 | - image: mongo 24 | name: mongo 25 | ports: 26 | - name: mongo 27 | containerPort: 27017 28 | volumeMounts: 29 | - name: mongo-persistent-storage 30 | mountPath: /data/db 31 | volumes: 32 | - name: mongo-persistent-storage 33 | persistentVolumeClaim: 34 | claimName: mongo-persistent-storage 35 | - 36 | apiVersion: v1 37 | kind: Service 38 | metadata: 39 | name: mongo 40 | labels: 41 | name: mongo 42 | spec: 43 | ports: 44 | - port: 27017 45 | targetPort: 27017 46 | selector: 47 | name: mongo 48 | - 49 | apiVersion: v1 50 | kind: PersistentVolumeClaim 51 | metadata: 52 | name: mongo-persistent-storage 53 | spec: 54 | accessModes: 55 | - ReadWriteOnce 56 | resources: 57 | requests: 58 | storage: 1Gi 59 | -------------------------------------------------------------------------------- /samples/web-nodejs-with-db-sample/nodejs-app.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: Template 3 | apiVersion: v1 4 | metadata: 5 | name: nodejs-app 6 | objects: 7 | - 8 | apiVersion: apps/v1 9 | kind: Deployment 10 | metadata: 11 | name: web 12 | labels: 13 | app: nodejs 14 | spec: 15 | replicas: 1 16 | selector: 17 | matchLabels: 18 | app: nodejs 19 | template: 20 | metadata: 21 | labels: 22 | app: nodejs 23 | name: web-controller 24 | spec: 25 | containers: 26 | - image: "${NODEJS_IMAGE}" 27 | command: ['tail', '-f', '/dev/null'] 28 | args: [] 29 | name: web 30 | ports: 31 | - containerPort: 3000 32 | name: http-server 33 | volumeMounts: 34 | - mountPath: /projects 35 | name: projects 36 | volumes: 37 | - name: projects 38 | persistentVolumeClaim: 39 | claimName: projects 40 | env: 41 | - name: HOME 42 | value: '/projects' 43 | - 44 | apiVersion: v1 45 | kind: PersistentVolumeClaim 46 | metadata: 47 | name: projects 48 | spec: 49 | accessModes: 50 | - ReadWriteOnce 51 | resources: 52 | requests: 53 | storage: 1Gi 54 | - 55 | apiVersion: v1 56 | kind: Service 57 | metadata: 58 | name: web 59 | labels: 60 | name: web 61 | spec: 62 | type: LoadBalancer 63 | ports: 64 | - name: web 65 | port: 80 66 | targetPort: 3000 67 | protocol: TCP 68 | selector: 69 | app: nodejs 70 | - 71 | apiVersion: route.openshift.io/v1 72 | kind: Route 73 | metadata: 74 | name: che 75 | spec: 76 | to: 77 | kind: Service 78 | name: web 79 | port: 80 | targetPort: web 81 | parameters: 82 | - name: NODEJS_IMAGE 83 | value: "node:0.10.40" 84 | --------------------------------------------------------------------------------