drone / go-convert

Package convert provides tools for converting pipeline configuration files to the Drone format.
Apache License 2.0
9 stars 8 forks source link

[downgrade] support matrix strategy steps #174

Closed jimsheldon closed 8 months ago

jimsheldon commented 8 months ago

This v1 yaml

stages:
- name: test
  spec:
    steps:
    - spec:
        steps:
        - name: deploystacks-0
          spec:
            run: bin/deploy $PROVIDER/$STACK
          strategy:
            spec:
              axis:
                PROVIDER:
                - aws
                STACK:
                - monitoring
                - app1
                - app2
            type: matrix
          type: script
      type: parallel
  type: ci
version: 1

Should convert to this v0 yaml

pipeline:
  identifier: default
  name: default
  orgIdentifier: default
  projectIdentifier: default
  properties:
    ci:
      codebase:
        build: <+input>
  stages:
  - stage:
      identifier: test
      name: test
      spec:
        cloneCodebase: true
        execution:
          steps:
          - parallel:
            - step:
                identifier: deploystacks0
                name: deploystacks-0
                spec:
                  envVariables:
                    PROVIDER: <+matrix.PROVIDER>
                    STACK: <+matrix.STACK>
                  shell: Sh
                  command: bin/deploy $PROVIDER/$STACK
                timeout: ""
                type: Run
                strategy:
                  matrix:
                    PROVIDER:
                    - aws
                    STACK:
                    - monitoring
                    - app1
                    - app2
        platform:
          arch: Amd64
          os: Linux
        runtime:
          spec: {}
          type: Cloud
      type: CI
jimsheldon commented 8 months ago

Added in #177