kestra-io / plugin-git

Apache License 2.0
3 stars 4 forks source link

`git.Push` can use custom flow folder, while `git.Sync` can't #46

Closed Ben8t closed 9 months ago

Ben8t commented 9 months ago

Feature description

With the git.Push task, it's possible to override the _flows folder to use custom one. This is very handy while git repository structure can be very specific to each user.

- id: "push"
    type: "io.kestra.plugin.git.Push"
    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

However the git.Sync task can't use a custom _flows folder. It's not possible to map one.

id: git-sync
namespace: integration
tasks:

  - id: git-sync
    type: io.kestra.plugin.git.Sync
    url: https://github.com/Ben8t/kestra_prod
    branch: test-git-ops
    username: Ben8t
    gitDirectory: my_flows # this doesn't work
    namespaceFilesDirectory: ns_script
    password: "{{ secret('GITHUB') }}"

triggers:
  - id: every_minute
    type: io.kestra.core.models.triggers.types.Schedule
    cron: "*/1 * * * *"
anna-geller commented 9 months ago

yup let's do that, added issue with a spec here https://github.com/kestra-io/plugin-git/issues/49