prefect.deployments.steps.pull
¶
Core set of steps for specifying a Prefect project pull step.
git_clone
¶
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
|
credentials |
optional
|
a GitHubCredentials, GitLabCredentials, or BitBucketCredentials block can be used to specify the |
None
|
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
a dictionary containing a |
Raises:
Type | Description |
---|---|
CalledProcessError
|
if the git clone command fails for any reason |
Examples:
Clone a public repository:
pull:
- prefect.deployments.steps.git_clone:
repository: https://github.com/PrefectHQ/prefect.git
Clone a branch of a public repository:
pull:
- prefect.deployments.steps.git_clone:
repository: https://github.com/PrefectHQ/prefect.git
branch: my-branch
Clone a private repository using a GitHubCredentials block:
pull:
- prefect.deployments.steps.git_clone:
repository: https://github.com/org/repo.git
credentials: "{{ prefect.blocks.github-credentials.my-github-credentials-block }}"
Clone a private repository using an access token:
pull:
- prefect.deployments.steps.git_clone:
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.deployments.steps.git_clone:
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.deployments.steps.git_clone:
repository: git@github.com:org/repo.git
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/steps/pull.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
git_clone_project
¶
Deprecated. Use git_clone
instead.
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/steps/pull.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
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/deployments/steps/pull.py
17 18 19 20 21 22 23 24 25 26 27 28 29 |
|