Settle on custom directory creation approach #16
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
/home/hub/customdirectory is somehow expected to exist during some step in theforgejo.pydeployment. This was evidenced when I removed thecustomizations_fetch_urlandcustomizations_annex_getconfig options from an inventory and ran the deployment, which gave an error:I worked around that using
ensure_dirs:That worked fine, but only for the case when I did not want customizations. When I then added back the
customizations_fetch_urlandcustomizations_annex_getconfig options and kept the workaround, and then ran the deployment again, I got:That line in the
annex.pyoperation is basically where the annex repo is initialized. But I'm guessing that theensure_dirscreated thecustomdirectory already, as a normal directory and not a git repo, which I think is what leads to the error. When i removed theensure_dirsworkaround and reran the deployment, the annex error disappeared.So I think I'm saying we should just have some fail proof way of handling the
customdirectory. E.g.:and/or better code comments / docs to describe this scenario.
Not creating the dir seems like a hacky workaround to me. It's not deploying anything that fails (cloning into an existing dir should work), but assessing what's to do in the first place. If the fact, that there is no repo yet lead to a failure at the point of annex-init, then establishing what's there to do was wrong earlier (establishing whether to clone).
I'll look into it.
So, there are multiple issues to deal with here:
customdir to exist, so it can be mounted into the service container. Hence, it's currently included in theensure_dirsdefault.annex.initcallshost.get_fact(git.GitConfig, repo=<path>)and that errors out when the local gitconfig doesn't exist, even though it would exist in the execution phase b/c the cloning preceeds annex init.customdir exists, forgejo puts an emptyconfdir underneath. That then leads to failure during the execution phase when the previous issue is fixed by a conditional, because now that destination dir for cloning isn't empty.Two options, I think:
I think the former is better for users playing around with this, the latter is smaller and easier on the deployment side.
Leaning toward the latter. Thoughts?