---
# [샘플] 반복 (foreach)
# iterator: List 또는 Map
# setValue: 현재 값 저장 태그
# setKey: Map 순회 시 key 저장 태그 (optional)

property:
  workspace: /path/to/project
  platforms:
  - ios
  - android
  envMap:
    dev: https://dev.example.com
    prod: https://prod.example.com

pipeline:
  id: main
  workflow:
  # List 순회
  - foreach:
      iterator: <!property.platforms>
      setValue: <@property.platform>
      on-do:
      - exe: print-platform

  # Map 순회 (key + value)
  - foreach:
      iterator: <!property.envMap>
      setKey: <@property.envName>
      setValue: <@property.envUrl>
      on-do:
      - exe: print-env

  # 중첩 foreach
  - foreach:
      iterator: <!property.platforms>
      setValue: <@property.platform>
      on-do:
      - foreach:
          iterator: <!property.envMap>
          setKey: <@property.envName>
          setValue: <@property.envUrl>
          on-do:
          - exe: print-matrix

commands:
- command: Print
  id: print-platform
  param:
    message: "플랫폼: <!property.platform>"

- command: Print
  id: print-env
  param:
    message: "환경: <!property.envName> → <!property.envUrl>"

- command: Print
  id: print-matrix
  param:
    message: "<!property.platform> / <!property.envName>: <!property.envUrl>"
