prefect.projects.steps.pull
¶
Core set of steps for specifying a Prefect project pull step.
git_clone_project
¶
Clones a git repository into the current working directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
repository |
str
|
the URL of the repository to clone |
required |
branch |
str
|
the branch to clone; if not provided, the default branch will be used |
None
|
include_submodules |
bool
|
whether to include git submodules when cloning the repository |
False
|
access_token |
str
|
an access token to use for cloning the repository; if not provided the repository will be cloned using the default git credentials |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
a dictionary containing a |
Raises:
Type | Description |
---|---|
subprocess.CalledProcessError
|
if the git clone command fails for any reason |
Examples:
Clone a public repository:
pull:
- prefect.projects.steps.git_clone_project:
repository: https://github.com/PrefectHQ/prefect.git
Clone a branch of a public repository:
pull:
- prefect.projects.steps.git_clone_project:
repository: https://github.com/PrefectHQ/prefect.git
branch: my-branch
Clone a private repository using an access token:
pull:
- prefect.projects.steps.git_clone_project:
repository: https://github.com/org/repo.git
access_token: "{{ prefect.blocks.secret.github-access-token }}" # Requires creation of a Secret block
x-token-auth
)
in your secret block. Refer to your git providers documentation for the correct authentication schema.
Clone a repository with submodules:
pull:
- prefect.projects.steps.git_clone_project:
repository: https://github.com/org/repo.git
include_submodules: true
Clone a repository with an SSH key (note that the SSH key must be added to the worker before executing flows):
pull:
- prefect.projects.steps.git_clone_project:
repository: git@github.com:org/repo.git
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/projects/steps/pull.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
set_working_directory
¶
Sets the working directory; works with both absolute and relative paths.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
directory |
str
|
the directory to set as the working directory |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
a dictionary containing a |
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/projects/steps/pull.py
15 16 17 18 19 20 21 22 23 24 25 26 27 |
|