Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
$SOURCE_DIR didn't update when I changed the spec yaml file
I created a
spec.yaml file with the line
source_dir: src in it. I created my app and pushed it with
doctl apps create --spec spec.yaml - all good so far.
After a few minutes the build failed, saying it couldn’t find a file that exists in the repo I pointed the spec to, but not within the
src folder. Ok this makes sense:
source_dir should just be the whole folder in my case, rather than
I tried to repair this by:
- removing the
source_dirline the yaml file
- Setting it to
source_dir: ./and then
Every change correctly restarted the build when I pushed it to my repo, so:
github: branch: main deploy_on_push: true
In the spec was working well.
On every rebuild, the
$SOURCE_DIR = src remained, and indeed I’d see
Using build context /workspace/src in the logs, and get the error again.
I expected one of my attempts to correctly set
$SOURCE_DIR to give a build context of just
Perhaps the github setup is correctly causing DO to listen to my repo, but not to update the spec itself.
Or there’s just some bad caching happening, and even my attempts to set
source_dir in the spec didn’t work because they were invalid
I deleted the app, removed the line from the spec and relaunched it. That worked.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×