prefapp / action-make-state-repos-dispatches

Action to calculate and dispatch image changes of a service, in multiple state repositories
MIT License
1 stars 0 forks source link

Config file for the action #2

Closed alambike closed 10 hours ago

alambike commented 4 months ago

Motivation

We want to define the structure of the action config file, that the user must have created in its repository.

Default config file path: .github/make_dispatches.yml

dispatches:
   # APIS
  - type: snapshots # MANDATORY
    flavors: # MANDATORY
      - default
    state_repos: # MANDATORY
      - repo: my-state-1 # (mandatory)
        dispatch_event_type: 'dispatch-image' # (optional)
        base_path: apps # (optional)
        tenant: mytenant1 # (mandatory)
        application: my-app # (mandatory)
        env: dev # (mandatory)
        service_names: ['controller'] # (mandatory)
        registry: my_registry_address # (OPTIONAL: if not specified uses org SNAPSHOTS or org RELEASES registry)
        image_repository: my-image #OPTIONAL: default to ${{ github.repository }}
        version: $branch_dev | $latest_release | $latest_prerelease | <release tag> | <commit-sha> # (mandatory)

      - repo: my-state-repo2
        registry: my_registry_address 
        tenant: mytenant2
        application: my-app2
        env: pre
        service_names: ['controller']
        version: $branch_dev | $latest_release | $latest_prerelease | <release tag> | <commit-sha> # (mandatory)

  # frontends
  - type: releases
    flavors:
      - flavor1
    state_repos:
      - repo: my_state_repo1
        base_path: apps
        tenant: mytenant1
        application: myapp1
        env: dev
        service_names: ['controller']
        version: $branch_dev | $latest_release | $latest_prerelease | <release tag> | <commit-sha> # (mandatory)

  - type: releases
    flavors: 
      - flavor2
    state_repos:
      - repo: my_state2
        tenant: 
        application: myapp1
        env: pre
        service_names: ['controller']
        version: $branch_main | $latest_release | $latest_prerelease | <release tag> | <commit-sha> # (mandatory)

Output

  with:
    input_matrix: | 
     {
        "images": [
          {
            "app": "rivulet",
            "base_folder": "",
            "env": "dev",
            "image": "cbxacr.azurecr.io/rivulet-client:9649954_rivulet-client-saas-dev",
            "message": "✔ Dispatching",
            "reviewers": [
              "tonirvega"
            ],
            "service_name": "rivulet-client",
            "tenant": "global"
          }
        ],
        "version": 4
      }
    token: ***

Acceptance criteria

alambike commented 3 months ago

@juanjosevazquezgil a JSON Schema and the schema validation is needed to close this issue as completed.