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 src
.
I tried to repair this by:
source_dir
line the yaml filesource_dir: ./
and then source_dir: /
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 /workspace
.
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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Update:
I think it’s because this isn’t how you can update your spec. You have to do it with e.g.
doctl apps update
or some other method; it won’t update based on the target repo.