Skip to content

Latest commit

 

History

History
173 lines (134 loc) · 4.37 KB

config.md

File metadata and controls

173 lines (134 loc) · 4.37 KB

Main elements of PWSHAKE configuration file

  • attributes: element

    Optional

    attributes:
      some_attribute: 
        nested_attribute1: this is 1
        nested_attribute2: that is 2
      composed_attribute:
      - 1
      - 2
      - 3
    

    Contains definition of data that passed into executable scripts as a single parameter.

    This parameter should be of type Powershell [hashtable] that allows to merge, interpolate and override contained values during PWSHAKE execution.

    The given example is transformed in the following Powershell [hashtable] and passed by PWSHAKE engine to every executable script defined in the tasks: element.

    @{
      attributes=@{
        some_attribute=@{
          nested_attribute1="this is 1";
          nested_attribute2="that is 2";
        };
        composed_attribute=@(1,2,3);
      }
    }
    

    See more about attributes:

  • includes: element

    Optional

    includes:
    - attributes.json
    - pwshake-ci\start-stage.yaml
    - pwshake-ci\stop-stage.yaml
    

    Contains list of file paths relational to the main pwshake.yaml that will be merged into the main config before PWSHAKE engine starts execution. It's useful for splitting long configurations to several meaningful parts.

    See more about includes:

  • templates: element

    Alias: actions:

    Optional

    templates:
      cmd:
        text: echo do_nothing
        powershell: |
          if (${is-Windows}) {
            cmd /c "$($cmd.text)" *>&1
          } else {
            bash -c "$($cmd.text)" *>&1
          }
    

    Contains named yaml structures that PWSHAKE engine substitutes in [step:] elements to short steps definitions or to reuse in frequent cases.

    See more about templates:

  • tasks: element

    Aliases: run_lists:, roles:

    Optional

    tasks:
      clean:
        only: (Test-Path ./results)
        steps:
        - powershell: rm ./results -recurse -force
      build:
      - run_build_script
      test:
      - powershell: dotnet test
      publish:
      - cmd: |
          python.exe ./tools/some_script.py --with long ^
          --list of --options that --doesnt feet ^
          --to single_line
    

    Contains definition of composed and interdependent tasks that will be performed by PWSHAKE engine by executing steps: which are defined as tasks: items.

    See more about tasks:

  • invoke_tasks: element

    Aliases: invoke_run_lists:, apply_roles:

    Optional

    invoke_tasks:
    - clean
    - build
    - test
    - publish
    

    Tells to PWSHAKE engine about consist and order of execution items defined in the tasks: element.

    See more about invoke_tasks:

  • scripts_directories: element

    Optional

    scripts_directories:
    - tests
    - tools
    

    Tells to PWSHAKE engine where to find scripts defined as items of the tasks: element.

    See more about scripts_directories:

  • attributes_overrides: element

    Optional

    attributes_overrides:
    - local
    - test
    - stage
    - prod
    

    Tells to PWSHAKE engine about list of metadata files and order of overriding attributes: in the main pwshake.yaml config file before the actual execution.

    See more about attributes_overrides:

  • resources: element

    Alias: repositories:

    Optional

    resources:
    - git:
        repo: https://github.com/wild-devops/pwshake.git
        ref: v1.0.0
        directories:
        - examples
        - doc
        target: .old_repo
    

    Tells to PWSHAKE engine about the source(-s) of outer resources that should be loaded before the current execution starts.

    See more about resources:

  • filters: element

    Optional

    filters:
      f-$capsed: |-
        { "$_".ToUpper() }
      f-braced: |-
        { "[$_]" }
    

    Tells to PWSHAKE engine to add small functions into the script execution context.

    These functions will be used into the PWSHAKE processing as attributes interpolators or helpers.

    See more about filters: