kestra-io / plugin-git

Apache License 2.0
3 stars 4 forks source link

Pushing only specific Flow #36

Closed Ben8t closed 8 months ago

Ben8t commented 10 months ago

Feature description

When using the git.Push task, it doesn't seem possible to push only one flow or specific ones with the flows property.

I tried with the following, using addFilesPattern on the _flows directory but it doesn't seem to work (I also tried with _flows/dev.gitPush.yml)

id: gitPush
namespace: dev
tasks:
  - id: "push"
    type: "io.kestra.plugin.git.Push"
    addFilesPattern:
      - _flows/gitPush
    flows:
      enabled: true
      gitDirectory: flows
    namespaceFiles:
      enabled: true
    branch: test-git-ops # mandatory, we'll create the branch if not exists
    url: https://github.com/Ben8t/kestra_prod
    username: Ben8t
    password: '{{ secret("GITHUB") }}'
    commitMessage: "test" # required
anna-geller commented 10 months ago

addFilesPattern is only for namespaces for now + only for directories

as discussed via Slack, we can try implementing in the same way as with Namespace Files through a list of regex patterns within include/exclude child properties of flows

id: gitPush
namespace: dev
tasks:
  - id: push
    type: io.kestra.plugin.git.Push
    flows:
      enabled: true
      include: 
        - "myflow_*" # include only flows that start with myflow_
    namespaceFiles:
      enabled: true
    branch: test-git-ops # mandatory, we'll create the branch if not exists
    url: https://github.com/Ben8t/kestra_prod
    username: Ben8t
    password: '{{ secret("GITHUB") }}'
    commitMessage: "test" # required
anna-geller commented 8 months ago

The issue will be addressed in the new task PushFlows 🎉 You can follow the progress and updates here https://github.com/kestra-io/plugin-git/issues/56