Repository navigation
Deploy main to ilserver4 automatically - #90
Merged
Merged
Conversation
deploy/manifest lists one auto installer whose inputs are what the running bot depends on. The installer runs update.sh from the fetched commit as the checkout's owner, and update.sh fast-forwards to exactly that commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #89
What changes
deploy/manifest: oneautoinstaller,deploy/install-ilserver4.sh. Its inputs are the code the running bot loads,requirements.txtand the deploy scripts. Tests, docs andsite/are left out, so changing them does not restart the bot.deploy/install-ilserver4.sh: run as root byilserver4-deploywithDEPLOY_COMMITset. It copiesupdate.shfrom the fetched commit to a root-owned temporary file and runs it as the checkout's owner. That way the version ofupdate.shbeing deployed is the one that runs, and git and pip never write root-owned files into the checkout.deploy/update.shtakes an optional commit and fast-forwards to exactly it. Without one it still runsgit pull --ff-only, as before for manual hosts.APP_DIRcan be passed in, because the installer feeds it a copy.tests/test_deploy_manifest.py: every file underdeploy/is mapped and every input exists. The agent refuses a commit with an unmapped file, so this catches it in the PR instead of in a failed deployment.Verified on ilserver4
Ran a probe through the same path: root, then
mktemp+install -m 0644, thenrunuser -u ashesofil -- env APP_DIR=... bash. Inside, it ran asashesofil,git fetch origin mainworked, a fast-forward from the deployed7649534is possible, andsudo -n truesucceeds. Nothing was restarted.The agent side, which sets
DEPLOY_COMMITand adds this repository, is Isma-L154/Project_ilserver4#88. This PR has to merge first: the agent refuses a repository withoutdeploy/manifest.