General
Adding projects
This section describes how to add one or more projects to a devfile.
Prerequisites
Procedure
Add a
projectssection in the devfile, containing a list of one or more projects.A minimal devfile with one single project
devfile.yamlschemaVersion: 2.1.0 metadata: name: petclinic-dev-environment version: 1.0.0 projects: - name: petclinic git: remotes: origin: "https://github.com/spring-projects/spring-petclinic.git" checkoutFrom: revision: mainA devfile with multiple projects
devfile.yamlschemaVersion: 2.1.0 metadata: name: example-devfile version: 1.0.0 projects: - name: frontend git: remotes: origin: "https://github.com/acmecorp/frontend.git" - name: backend git: remotes: origin: "https://github.com/acmecorp/backend.git"For each project, define an unique value for the mandatory
nameattribute.For each project, define a mandatory source of either the
gitorziptype.Projects with sources in Git.
checkoutFromrefers to the branch being used.git
devfile.yamlprojects: - name: my-project1 git: remotes: origin: "https://github.com/my-org/project1.git" checkoutFrom: revision: mainProjects with sources in a ZIP archive.
locationrefers to the URL of a ZIP file.zip
devfile.yamlsource: zip: location: http://host.net/path/project-src.zipFor each project, define the optional
clonePathattribute to specify the path into which the project is to be cloned. The path must be relative to the/projects/directory, and it cannot leave the/projects/directory. The default value is the project name.Defining the clonePath attribute
devfile.yamlschemaVersion: 2.1.0 metadata: name: my-project-dev version: 2.0.0 projects: - name: my-project-resource clonePath: resources/my-project zip: location: http://host.net/path/project-res.zip - name: my-project2 git: remotes: origin: "https://github.com/my-org/project2.git" checkoutFrom: revision: develop