Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/push-task #19

Merged
merged 2 commits into from
Dec 8, 2023
Merged

feat/push-task #19

merged 2 commits into from
Dec 8, 2023

Conversation

brian-mulier-p
Copy link
Member

closes #16

@brian-mulier-p brian-mulier-p self-assigned this Dec 6, 2023
@brian-mulier-p brian-mulier-p force-pushed the feat/push-task branch 3 times, most recently from 6704878 to 9d0aabe Compare December 6, 2023 18:10
Copy link
Member

@anna-geller anna-geller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the main use case to push namespaceFiles to a Git feature branch (without git.Clone) doesn't work yet:

image

id: push
namespace: dev

inputs:
  - name: commit_message
    type: STRING
    defaults: commit namespace files

tasks:
  - id: push
    type: io.kestra.plugin.git.Push
    url: https://github.com/anna-geller/kestra
    namespaceFiles:
      enabled: true
    branch: main
    username: anna-geller
    password: ghp_xxxxx
    commitMessage: "{{ inputs.commit_message }}"

Copy link
Member

@anna-geller anna-geller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works now 🎉

with inputFiles:
image

image

and here with namespace files:

image

id: push
namespace: dev

inputs:
  - name: commit_message
    type: STRING
    defaults: my commit message

tasks:
  - id: push
    type: io.kestra.plugin.git.Push
    commitMessage: "{{ inputs.commit_message }}"
    branch: feature
    url: https://github.com/anna-geller/kestra
    username: anna-geller
    password: xxx
    inputFiles:
      hello.txt: hello from a flow

src/main/java/io/kestra/plugin/git/AuthentifiedTask.java Outdated Show resolved Hide resolved
src/main/java/io/kestra/plugin/git/FromRepository.java Outdated Show resolved Hide resolved
src/main/java/io/kestra/plugin/git/Push.java Outdated Show resolved Hide resolved
src/main/java/io/kestra/plugin/git/Push.java Show resolved Hide resolved
src/main/java/io/kestra/plugin/git/Push.java Outdated Show resolved Hide resolved
build.gradle Show resolved Hide resolved
@brian-mulier-p
Copy link
Member Author

brian-mulier-p commented Dec 8, 2023

@anna-geller if you want to test the two-step push, I hacked around cloning 2 repos because I don't have write rights on scripts repo (I used directory to push only input files & not scripts)

id: flow
namespace: dev

inputs:
  - name: commit_message
    type: STRING
    defaults: my commit message

tasks:
  - id: wdir
    type: io.kestra.core.tasks.flows.WorkingDirectory
    tasks:
      - id: clone_unit
        type: io.kestra.plugin.git.Clone
        url: https://github.com/kestra-io/unit-tests
        username: pat
        password: pat
      - id: clone
        type: io.kestra.plugin.git.Clone
        url: https://github.com/kestra-io/scripts
        directory: scripts
      - id: gen_data
        type: io.kestra.plugin.scripts.python.Commands
        docker:
          image: ghcr.io/kestra-io/pydata:latest
        commands:
          - python scripts/generate_data/generate_orders.py
      - id: push
        type: io.kestra.plugin.git.Push
        username: pat
        password: pat
        branch: test
        inputFiles:
          to_commit/avg_order.txt: "{{ outputs.gen_data.vars.average_order }}"
        addFilesPattern: 
          - to_commit
        description: Adds all namespace files, commits and pushes them
        commitMessage: "{{ inputs.commit_message }}"

@brian-mulier-p brian-mulier-p force-pushed the feat/push-task branch 2 times, most recently from 1a5b514 to 5bd02a1 Compare December 8, 2023 08:24
Copy link
Member

@loicmathieu loicmathieu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brian-mulier-p brian-mulier-p force-pushed the feat/push-task branch 3 times, most recently from c67cd4d to 55eda08 Compare December 8, 2023 09:32
@brian-mulier-p brian-mulier-p merged commit 68947fb into master Dec 8, 2023
1 check passed
@anna-geller
Copy link
Member

super later but just info: I verified the example flow you provided works well on develop image @brian-mulier-p

image

@loicmathieu loicmathieu deleted the feat/push-task branch January 3, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New git.Push task allowing to push namespaceFiles and custom inputFiles to a Git branch
3 participants