pipecd icon indicating copy to clipboard operation
pipecd copied to clipboard

[piped] Implement regex-based dynamic changes in the event watcher

Open moko-poi opened this issue 2 years ago • 1 comments

What would you like to be added: Currently, the event watcher modifies specific locations in a designated file, making it dependent solely on yaml files. To enhance flexibility, we propose adding a feature to identify and modify matching sections using regular expressions.

For instance:

terraform.tfvars

batch_image_uri = "{account_id}.dkr.ecr.ap-northeast-1.amazonaws.com/{project}-{application_name}:rc-202309111328"
dbt_image_uri = "{account_id}.dkr.ecr.ap-northeast-1.amazonaws.com/{project}-{application_name}::rc-202309121257"
refresher_image_uri = "{account_id}.dkr.ecr.ap-northeast-1.amazonaws.com/{project}-{application_name}::rc-202307140930"

app.pipecd.yaml

  eventWatcher:
    - matcher:
        name: stg-service-data-image-update
      handler:
        type: GIT_UPDATE
        config:
          commitMessage: "[stg] Upgrade service-data service to the latest version"
          replacements:
            - file: terraform.tfvars
              regex: "{account_id}.dkr.ecr.ap-northeast-1.amazonaws.com/{project}-{application_name}:(rc-[0-9]{12})"

Why is this needed:

moko-poi avatar Sep 13 '23 08:09 moko-poi

Sounds good to me 👍

kentakozuka avatar Oct 24 '23 10:10 kentakozuka

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 22 '24 00:04 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.

github-actions[bot] avatar Apr 30 '24 00:04 github-actions[bot]