Skip to content

Manifest

fire-dragon edited this page May 13, 2021 · 6 revisions

Quick Start

Draft of workflow template can be created using the following command:

CodeReview.Orchestrator.exe new -o manifest.yaml

Output of this command may look as follows:

imports:
  folderPath: ./imports
sources:
  folderPath: ./src
artifacts:
  folderPath: ./artifacts
  exportOnCompletion: true
variables:
  MY_VAR_1: Value1
  MY_VAR_2: Value2
activities:
  git:
    image: dragon/jetbrains
    environment:
      MY_VAR_1: Value1
      MY_VAR_2: Value2
    volumes:
      useWindowsDefaults: false
      sources: /src
      artifacts: /artifacts
      imports: /imports
    settings:
      waitTimeoutSeconds: 3000
    requirements:
      os: Linux
      features:
      - feature1
    command:
    - mkdir
    - /mydir

Manifest Description

Typical manifest may look as follows:

imports:
  folderPath: ./imports
sources:
  folderPath: ./src
artifacts:
  exportOnCompletion: true
variables: 
  srcPath: /src
activities:
  git:
    image: godeltech/codereview.tools.gitprovider
    environment:
      GIT_REPOSITORY_URL: https://github.com/GodelTech/CodeReview.Orchestrator.git
      GIT_BRANCH: main
    volumes:
      sources: ${var.srcPath}
  roslyn:
    image: godeltech/codereview.analyzers.roslyn
    environment:
      SOLUTION_FILE_PATH: /src/CodeReview.Orchestrator.sln
    volumes:
      sources: ${var.srcPath}
  roslyn-converter:
    image: godeltech/codereview.file-converter
    command:
    - roslyn
    - --output
    - /artifacts/rolsyn-result.zip
    - --folder
    - /artifacts
    - --src
    - ${var.srcPath}/
    - --mask
    - '*.roslyn.json'    
  

Manifest Properties

Imports Section

imports section defines settings used to initialize imports volume. List of properties can be found in the following table:

Property Mandatory Default Value Description
folderPath false ./imports Specifies location of folder to import into imports container. If relative path is specified manifest location is used as current directory. If folder specified in this property doesn't exist no import is performed.

Sources Section

sources section defines settings used to initialize sources volume. List of properties can be found in the following table:

Property Mandatory Default Value Description
folderPath false ./src Specifies location of folder to import into src container. If relative path is specified manifest location is used as current directory. If folder specified in this property doesn't exist no import of source code is performed.

Artifacts Section

artifacts section defines settings used to initialize artifacts volume. List of properties can be found in the following table:

Property Mandatory Default Value Description
folderPath false ./artifacts Specifies location of folder to export content of artifacts volume data.
exportOnCompletion false false Specifies if artifact volume needs to be exported or not after workflow execution is completed.

Variables

TBD

Manifest Best Practices

The following guidelines may simplify creation and maintenance of CodeReview.Orchestrator manifests:

  • Avoid explicit declaration of parameters if values match defaults. This approach makes manifests shorter and easier to understand.
  • Consider usage of long parameter names. Many command line tools support long and short command line parameter names: -d and --destination. Long parameter names provide better understanding of their purpose and eliminate a need to study documentation of tool to understand parameter.
  • Use variables to avoid duplication of the same parameters in multiple places.
  • Use environent variables to pass security information rather than hardcode passwords and tokens in manifests.

Clone this wiki locally