Skip to content

Enable object variables and ForEach menu item#37

Merged
coenm merged 11 commits intomainfrom
feature/objectVariables
Nov 17, 2022
Merged

Enable object variables and ForEach menu item#37
coenm merged 11 commits intomainfrom
feature/objectVariables

Conversation

@coenm
Copy link
Copy Markdown
Owner

@coenm coenm commented Nov 15, 2022

For instance:

{
  "variables": [
    {
      "name": "DTAP",
      "value": [
        {
          "key": "D",
          "url": "https://develop.local"
        },
        {
          "key": "T",
          "url": "https://test.local"
        },
        {
          "key": "A",
          "url": "https://acceptance.local"
        },
        {
          "key": "P",
          "url": "https://production.local"
        }
      ]
    }
  ],

  "repository-actions": {
    "actions": [
      {
        "type": "foreach@1",
        "enumerable": "{var.DTAP}",
        "variable": "environment",
        "skip": "{StringEquals({var.environment.key}, T)}",
        "actions": [
          {
            "type": "browser@1",
            "name": "{var.environment.key}",
            "url": "{var.environment.url}"
          }
        ]
      }
    ]
  }
}

or equivalent in yml:

variables:
- name: DTAP
  value:
  - key: D
    url: https://develop.local
  - key: T
    url: https://test.local
  - key: A
    url: https://acceptance.local
  - key: P
    url: https://production.local

repository-actions:
  actions:
  - type: foreach@1
    enumerable: '{var.DTAP}'
    skip: '{StringEquals({var.environment.key}, T)}'
    variable: environment
    actions:
    - type: browser@1
      name: '{var.environment.key}'
      url: '{var.environment.url}'

@coenm coenm added the enhancement 🚀 Enhancements label Nov 15, 2022
@coenm
Copy link
Copy Markdown
Owner Author

coenm commented Nov 15, 2022

Implementes #34 and #35

@coenm
Copy link
Copy Markdown
Owner Author

coenm commented Nov 16, 2022

Inline variables doesn't work

@coenm coenm merged commit 3b52449 into main Nov 17, 2022
@coenm coenm deleted the feature/objectVariables branch November 17, 2022 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 🚀 Enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant