#
# Copyright (c) 2012-2021 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
#   Red Hat, Inc. - initial API and implementation
#

schemaVersion: "2.0.0"
metadata:
  name: "myDevfile"
  version: "0.0.1"
projects:
  - name: "devworkspace-spec"
    git:
      remotes:
        origin: "https://github.com/devfile/api"
commands:
  - id: buildschema
    exec:
      label: Build the schema
      commandLine: "./buildSchema.sh"
      component: build-tools
      group:
        kind: build
        isDefault: true
  - id: opendevfile
    vscodeTask:
      inlined:
        json        
  - id: build-schema-and-open-devfile
    composite:
      label: Build schema and open devfile
      commands:
        - buildschema
        - opendevfile
      parallel: false
  - id: helloworld
    exec:
      env:
        - name: "USER"
          value: "John Doe"
      commandLine: 'echo "Hello ${USER}"'
      component: build-tools
events:
  postStart:
    - "build-schema-and-open-devfile"
components:
  - name: yaml-support
    plugin:
      id: redhat/vscode-yaml/latest
  - name: go-support
    plugin:
      id: ms-vscode/go/latest
  - name: editor
    plugin:
      id: eclipse/che-theia/latest
      registryUrl: "external-registry-url"
  - name: "build-tools"
    container:
      image: some container image with required build tools
      mountSources: true
      sourceMapping: /home/src
