forked from devfile/devfile-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update devfile schema based on devfile/api@c088cf3
Signed-off-by: Theofanis Petkos <thepetk@gmail.com>
- Loading branch information
Showing
30 changed files
with
4,631 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
2.1.0 | ||
2.2.0 | ||
2.2.1 | ||
2.2.2 | ||
2.2.2 | ||
2.3.0 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
title: Adding a command group | ||
description: Adding a command group | ||
--- | ||
|
||
Create command groups to help automate your devfile. | ||
|
||
## Procedure | ||
|
||
1. Assign a given command to one or more groups that represent the | ||
nature of the command. | ||
|
||
2. Use the following supported group kinds: `build`, `run`, `test`, | ||
`debug` or `deploy` | ||
|
||
3. At most, there can only be one default command for each group kind. | ||
Set the default command by specifying `isDefault` to `true`. | ||
|
||
```yaml {% filename="devfile.yaml" %} | ||
schemaVersion: 2.2.0 | ||
metadata: | ||
name: mydevfile | ||
projects: | ||
- name: my-maven-project | ||
clonePath: maven/src/github.com/acme/my-maven-project | ||
git: | ||
remotes: | ||
origin: 'https://github.com/acme/my-maven-project.git' | ||
components: | ||
- name: maven | ||
container: | ||
image: eclipse/maven-jdk8:latest | ||
mountSources: true | ||
command: ['tail'] | ||
commands: | ||
- id: package | ||
exec: | ||
component: maven | ||
commandLine: 'mvn package' | ||
group: | ||
kind: build | ||
- id: install | ||
exec: | ||
component: maven | ||
commandLine: 'mvn install' | ||
group: | ||
kind: build | ||
isDefault: true | ||
``` | ||
4. Use the `deploy` kind to reference a deploy command for an outerloop | ||
scenario. | ||
|
||
```yaml {% filename="devfile.yaml" %} | ||
schemaVersion: 2.2.0 | ||
metadata: | ||
name: python | ||
version: 1.0.0 | ||
provider: Red Hat | ||
supportUrl: https://github.com/devfile-samples/devfile-support#support-information | ||
attributes: | ||
alpha.dockerimage-port: 8081 | ||
parent: | ||
id: python | ||
registryUrl: 'https://registry.devfile.io' | ||
components: | ||
- name: outerloop-build | ||
image: | ||
imageName: python-image:latest | ||
dockerfile: | ||
uri: docker/Dockerfile | ||
buildContext: . | ||
rootRequired: false | ||
- name: outerloop-deploy | ||
kubernetes: | ||
uri: outerloop-deploy.yaml | ||
commands: | ||
- id: build-image | ||
apply: | ||
component: outerloop-build | ||
- id: deployk8s | ||
apply: | ||
component: outerloop-deploy | ||
- id: deploy | ||
composite: | ||
commands: | ||
- build-image | ||
- deployk8s | ||
group: | ||
kind: deploy | ||
isDefault: true | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: Adding a composite command | ||
description: Adding a composite command | ||
--- | ||
|
||
Connect multiple commands together by defining a composite command. | ||
|
||
## Procedure | ||
|
||
1. Reference the individual commands that are called from a composite | ||
command by using the `id` of the command. | ||
|
||
2. Specify whether to run the commands within a composite command in | ||
sequence or parallel by defining the `parallel` property | ||
|
||
```yaml {% filename="devfile.yaml" %} | ||
schemaVersion: 2.2.0 | ||
metadata: | ||
name: mydevfile | ||
projects: | ||
- name: my-maven-project | ||
clonePath: maven/src/github.com/acme/my-maven-project | ||
git: | ||
remotes: | ||
origin: 'https://github.com/acme/my-maven-project.git' | ||
components: | ||
- name: maven | ||
container: | ||
image: eclipse/maven-jdk8:latest | ||
mountSources: true | ||
command: ['tail'] | ||
commands: | ||
- id: package | ||
exec: | ||
component: maven | ||
commandLine: 'mvn package' | ||
group: | ||
kind: build | ||
- id: install | ||
exec: | ||
component: maven | ||
commandLine: 'mvn install' | ||
group: | ||
kind: build | ||
isDefault: true | ||
- id: installandpackage | ||
composite: | ||
commands: | ||
- install | ||
- package | ||
parallel: false | ||
``` |
128 changes: 128 additions & 0 deletions
128
libs/docs/src/docs/2.3.0/adding-a-container-component.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
--- | ||
title: Adding a container component | ||
description: Adding a container component | ||
--- | ||
|
||
To incorporate custom tools into the workspace, define an image-based | ||
configuration of a container in a workspace using the `container` component type. | ||
|
||
## Prerequisites | ||
|
||
- [Adding schema version](./versions) | ||
|
||
- [Adding a name](./metadata) | ||
|
||
- [Adding components](./adding-components) | ||
|
||
## Procedure | ||
|
||
1. Define a component using the type `container`. | ||
|
||
```yaml {% title="A container component" filename="devfile.yaml" %} | ||
components: | ||
- name: maven | ||
container: | ||
image: eclipse/maven-jdk8:latest | ||
volumeMounts: | ||
- name: mavenrepo | ||
path: /root/.m2 | ||
env: | ||
- name: ENV_VAR | ||
value: value | ||
endpoints: | ||
- name: maven-server | ||
targetPort: 3101 | ||
protocol: https | ||
secure: 'true' | ||
exposure: public | ||
memoryRequest: 256M | ||
memoryLimit: 1536M | ||
cpuRequest: 0.1 | ||
cpuLimit: 0.5 | ||
command: ['tail'] | ||
args: ['-f', '/dev/null'] | ||
``` | ||
```yaml {% title="A minimal container component" filename="devfile.yaml" %} | ||
schemaVersion: 2.2.0 | ||
metadata: | ||
name: mydevfile | ||
components: | ||
- name: go | ||
container: | ||
image: golang | ||
memoryLimit: 512Mi | ||
command: ['sleep', 'infinity'] | ||
``` | ||
Specify the type of component using the `container` property. Use | ||
the `image` property to specify the image for the component. When | ||
defining the `image`, use container naming conventions. For example, | ||
the `image` property in the preceding example refers to the | ||
container image, `docker.io/library/golang:latest`. | ||
|
||
Use the `container` component to augment the image with additional | ||
resources and information. This component allows you to integrate | ||
the tooling provided by the image with the application that consumes | ||
the devfile. | ||
|
||
2. Mounting project sources | ||
|
||
For the `container` component to have access to the project sources, | ||
you must set the `mountSources` attribute to `true`. | ||
|
||
```yaml {% filename="devfile.yaml" %} | ||
schemaVersion: 2.2.0 | ||
metadata: | ||
name: mydevfile | ||
components: | ||
- name: go | ||
container: | ||
image: golang | ||
memoryLimit: 512Mi | ||
mountSources: true | ||
command: ['sleep', 'infinity'] | ||
``` | ||
|
||
The sources are mounted on a location stored in the `PROJECTS_ROOT` | ||
environment variable that is made available in the running container | ||
of the image. This location defaults to `/projects`. If | ||
`sourceMapping` is defined in the container, it overrides the | ||
`PROJECT_ROOT` value and mounts the source to the path defined by | ||
`sourceMapping`. | ||
|
||
3. Specify a volume | ||
|
||
For the `container` component to have a shared volume, you must | ||
define a volume component in the devfile and reference the volume | ||
using `volumeMount` in container component. For more information on | ||
volume component, see [adding a volume component](./adding-a-volume-component). | ||
|
||
```yaml {% filename="devfile.yaml" %} | ||
components: | ||
- name: mycontainer | ||
container: | ||
image: java11-maven:next | ||
memoryLimit: 768Mi | ||
mountSources: true | ||
volumeMounts: | ||
- name: m2 | ||
path: /home/user/.m2 | ||
- name: m2 | ||
volume: | ||
size: 1Gi | ||
``` | ||
|
||
4. Container Entrypoint | ||
|
||
Use the `command` attribute of the `container` type to modify the | ||
`entrypoint` command of the container created from the image. The | ||
availability of the `sleep` command and the support for the | ||
`infinity` argument depend on the base image used in the particular | ||
images. | ||
|
||
## Additional Resources | ||
|
||
- [API Reference](./devfile-schema) | ||
|
||
- [Devfile resources](./resources) |
60 changes: 60 additions & 0 deletions
60
libs/docs/src/docs/2.3.0/adding-a-kubernetes-or-openshift-component.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
title: Adding a kubernetes or openshift component | ||
description: Adding a kubernetes or openshift component | ||
--- | ||
|
||
You can add either a `kubernetes` or `openshift` component to a devfile. | ||
|
||
## Prerequisites | ||
|
||
- [Adding schema version](./versions) | ||
|
||
- [Adding a name](./metadata) | ||
|
||
- [Adding components](./adding-components) | ||
|
||
## Procedure | ||
|
||
1. Define a component using the `kubernetes` or `openshift` property. | ||
|
||
2. Provide the content through the `uri` or `inlined` property. | ||
|
||
```yaml {% title="Adding an openshift component using the uri property" filename="devfile.yaml" %} | ||
components: | ||
- name: mysql | ||
openshift: | ||
uri: petclinic.yaml | ||
``` | ||
```yaml {% title="Adding a kubernetes component using the inlined property" filename="devfile.yaml" %} | ||
components: | ||
- name: myk8deploy | ||
kubernetes: | ||
inlined: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: pi | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: job | ||
image: myimage | ||
command: ["some", "command"] | ||
restartPolicy: Never | ||
``` | ||
3. Specify the endpoint through the endpoint property with `kubernetes` | ||
or `openshift` components. | ||
|
||
4. By default `kubernetes` or `openshift` components are not going to | ||
be deployed. Specify `deployByDefault: true` if you want to apply the | ||
component at start up. | ||
|
||
5. Associate `kubernetes` or `openshift` components with `apply` | ||
commands wth `deploy` command group kind. If the `kubernetes` or | ||
`openshift` component uses an image built by an `image` component | ||
defined in the devfile, you can create a composite `deploy` command | ||
to build the image and deploy the `kubernetes` or `openshift` component. | ||
For more information on `deploy` commands, see [adding a command group](./adding-a-command-group). |
Oops, something went wrong.