Skip to content

Parent Devfiles and workingDir vs clonePath issue #109

@kadel

Description

@kadel

Currently clonePath defaults to the project name. This means that by default source code is cloned into /project/<project-name>. This is problematic for Stacks (Parent Devfiles) as they can't know where the project source code will be.

Example:

How should I set workingDir in my example devfile.yaml so It is generic enough that it can be used without everyone overriding workingDir for all commands?

# parent.yaml
schemaVersion: 2.0.0
metadata:
  name: java
components:
  - container:
      name: tools
      image: quay.io/eclipse/che-java11-maven:nightly
      mountSources: true
commands:
  - exec:
      id: mvn-package
      component: tools
      commandLine: "mvn package"
      # workingDir: ?????
      group:
        kind: build
        isDefault: true
  - exec:
      id: run
      component: tools
      commandLine: "java -jar target/*.jar"
      # workingDir: ?????
      group:
        kind: run
        isDefault: true

Now I want to use this in my local devfile.yaml

# devfile.yaml
schemaVersion: 2.0.0
metadata:
  name: myproject
projects:
  - name: myproject
      git:
        location: https://github.com/example/example
parent:
  uri: https://registry.example.com/java/parent.yaml

This won't work because commands in parent devfile don't specify workingDir so it will default to container working directory (in this case /project). But I can't set working dir in parent devfile, because I can't know what will be the project name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions