https://prefect.io logo
k

Krishnan Chandra

08/24/2022, 6:12 PM
Hey folks! I’m currently trying to solve an issue with Prefect 2.0 when building a deployment via CI - currently, the deployment uses local storage and the path to the code within the CI environment doesn’t match the path in the runtime environment. I’ve been trying to figure out how to override the path in the
prefect deployment build
command, but this hasn’t worked:
Copy code
prefect deployment build \
          ...
          --override path=/app/
Is there a way to override the path setting, or is this something I’d need to modify in the YAML files after generation?
1
1
c

Clint M

08/24/2022, 6:32 PM
I did this the other day with `yq`… here’s the docker version:
Copy code
docker run \
--rm \
-v $(PWD):/workdir/ \
mikefarah/yq:4.27.2 -i '.path = "/home/app/code"' /workdir/deployments/$(DEPLOY_ENV).yaml
I build the deployment with
prefect deployment build --output deployments/$(DEPLOY_ENV).yaml
so the plain yq syntax would be
yq -i '.path = "/home/app/code"' deployments/$(DEPLOY_ENV).yaml
and it changes the path to
/home/app/code
the path in my docker image
🙌 1
k

Krishnan Chandra

08/24/2022, 6:36 PM
Good to know, thanks! I was using
sed
instead of
yq
but your way is definitely cleaner 🙂
c

Clint M

08/24/2022, 6:37 PM
probably nothing wrong with sed 🙂
3 Views