https://prefect.io logo
g

Grant

07/06/2023, 7:45 PM
I can't seem to find any documentation on the syntax for configuring a git push in a .yaml file. The following syntax does not work for push, what should it be?
Copy code
# Welcome to your prefect.yaml file! You can you this file for storing and managing
# configuration for deploying your flows. We recommend committing this file to source
# control along with your flow code.

# Generic metadata about this project
name: Prefect_Cert_Course
prefect-version: 2.10.18

# build section allows you to manage and build docker images
build: null

# push section allows you to manage if and how this project is uploaded to remote locations
push: # ADD GIT PUSH STUFF HERE
- prefect.deployments.steps.git_push:
    repository: <https://github.com/grant-arbuckle/Prefect_Cert_Course>
    branch: main

# pull section allows you to provide instructions for cloning this project in remote locations
pull:
# - prefect.deployments.steps.set_working_directory:
#     directory: C:\Users\grant.arbuckle\Prefect_Cert_Course
- prefect.deployments.steps.git_clone:
    repository: <https://github.com/grant-arbuckle/Prefect_Cert_Course>
    branch: main

# the deployments section allows you to provide configuration for deploying flows
deployments:
- name: pipe3_for_class
  version: null
  tags: []
  description: null
  entrypoint: 104.py:pipe3
  parameters: {}
  work_pool:
    name: pool-for-prefect-class
    work_queue_name: null
    job_variables: {}
  schedule: null
👀 1
j

Jeff Hale

07/06/2023, 7:47 PM
I didn’t think it was possible, but @Emil Christensen seems to think it is, so I’ll let him address. 😉
👍 1
e

Emil Christensen

07/06/2023, 7:49 PM
There’s no
git_push
step, but you can accomplish it with the
run_shell_script
step:
Copy code
push:
    - prefect.deployments.steps.run_shell_script:
        id: git-push
        script: git push origin
        stream_output: false
🧠 1
🙌 1
j

Jeff Hale

07/06/2023, 7:49 PM
ah! Clever!
e

Emil Christensen

07/06/2023, 7:49 PM
Essentially, you’re using
prefect deploy
to run shell commands.
Creating a single convenient command
^ That would still require adding and committing files of course