<@ULVA73B9P> when using `from_source` and a git re...
# ask-marvin
g
@Marvin when using
from_source
and a git repo, how do I specify a custom directory on the deployment server to install the flow code into?
m
It appears there's some relevant information scattered across different documents. Here’s a summary: To specify a custom directory on the deployment server for installing the flow code when using
from_source
with a git repository: 1. Cloning Process: Prefect clones the repository to a temporary directory:
Copy code
with TemporaryDirectory(suffix="prefect") as tmp_dir:
       cmd.append(tmp_dir)
2. Copying to Target Directory: Use
copy_tree
to move the desired subdirectory from the temporary directory to your specified directory:
Copy code
content_source, content_destination = self._get_paths(dst_dir=local_path, src_dir=tmp_dir, sub_directory=from_path)
   copy_tree(src=content_source, dst=content_destination)
Unfortunately, specific examples of setting the target directory directly in the Prefect configuration were not found. For deeper insights, you might refer to the following documentation links: - Setting up repositories: https://docs.prefect.io/latest/integrations/prefect-bitbucket/repository/ - Work pool deployments: https://docs.prefect.io/latest/tutorial/work-pools/ - Deployment guides: https://docs.prefect.io/latest/guides/prefect-deploy/ I hope this helps. For exact directives, you might want to refer to Prefect's community or support for the most tailored guidance.