summaryrefslogtreecommitdiffstats
path: root/acid/acid-source (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2023-11-17acid: source: Only record commit hashesMalfurious1-6/+7
Previously, the object hash computed by `git for-each-ref` was the value we cached in the 'previous_hash' file. If the matching ref was an annotated tag, then this was the tag's hash, not the commit hash it pointed to. Now, always dereference tags to their commit object, and store this value instead. This consistency will improve the web UX in my opinion. Signed-off-by: Malfurious <m@lfurio.us>
2023-11-17acid: source: Initialize cached hash to NULLMalfurious1-1/+1
For some consistency, initialize repos' previous_hash to the NULL hash (all zeros). This should prevent empty values on the user interface. Signed-off-by: Malfurious <m@lfurio.us>
2023-11-17acid: source: Prevent creation of local branches/refsMalfurious1-4/+15
Previously (and as is the default behavior in git), when cloning fresh cache repositories for user services, we would acquire current remote-tracking branches, tags, and a local branch tracking origin/HEAD. In practice, this local branch becomes vestigial. As we fetch updates, we always checkout by commit hash and leave the repository in a detached HEAD. The local branch reference is therefore never updated. This is fine for the functionality of ACID. However, if querying the repo for information about the current version, it is possible for tools like `git describe` to describe HEAD in terms of this stale branch ref. Now, when we clone a repository arrange for there to be no 'local' branch references. Only remote-tracking branches and tags. Remote-tracking branches are properly updated and removed by our fetch command. Additionally, prevent the remote 'origin/HEAD' symbolic ref, since it would be mildly confusing for it to pop up to the user as well. In effect, we limit our ref namespace only to branches and tags that actually exist on the remote host. Signed-off-by: Malfurious <m@lfurio.us>
2023-11-02acid: source: Return null hash on errorMalfurious1-6/+11
This seems like a more consistent behavior. Also, I would like to embed the git hash into the build log record somehow. Returning all zeroes in an error case allows the main script to simply pass along the result instead of worrying about an edge case. Signed-off-by: Malfurious <m@lfurio.us>
2023-11-02Merge data volumesMalfurious1-1/+1
I need something more complicated than just 1 new directory for logs, so let's go to the trouble now of merging the persistent volumes together and use subdirectories/files. The default location is now '/data'. To aid similar changes in the future, the locations of these persistent files are no longer hard-coded in the source, but defined by global shell variables. Additionally, a bug is fixed which impacted our ability to accurately clean old logs and calculate the next job number. Signed-off-by: Malfurious <m@lfurio.us>
2023-10-26acid: Don't use 'cychedelic' in file namesMalfurious1-1/+1
As I add new components to the cychedelic system, it would be best to use more specific naming. 'cychedelic' is the name of the project, whereas 'acid' is the name of this program. Signed-off-by: Malfurious <m@lfurio.us>
2023-09-10acid: Sanitize filename inputs from the configMalfurious1-0/+6
Prevent the creation or access of unintended files in the ACID container. Also, assert that names are valid for docker before attempting to deploy images. Signed-off-by: Malfurious <m@lfurio.us>
2023-09-10Revert "acid: build: Cache path to the docker-compose.yml file"Malfurious1-1/+0
This ends up being unnecessary. We don't need the content of the YML file to correctly clean up resources. Docker compose inherently knows how to handle it. As long as we operate with the correct --project-name (whether it's explicitly given, or determined by current directory), `docker compose down` will do the job. We can therefore run from a workind directory that is unrelated to the target service, even if it contains a different docker-compose.yml file. This reverts commit 7a7ff89ff16542d30ff7c1f70689236b8fd9c607. Signed-off-by: Malfurious <m@lfurio.us>
2023-09-08acid: build: Cache path to the docker-compose.yml fileMalfurious1-0/+1
When a service entry is removed from $CYCHE_SERVICES, this value is lost, preventing us from properly tearing down the service. Signed-off-by: Malfurious <m@lfurio.us>
2023-08-18acid: source: Display git submodule entries in the logMalfurious1-1/+1
It can be useful to confirm which submodules (and versions) are present for a build, and the output isn't all that noisy either. Just 1 or 2 lines should be printed for each submodule. Signed-off-by: Malfurious <m@lfurio.us>
2023-08-18acid: source: Summarize commit we are building fromMalfurious1-0/+3
For the sake of the logs, print out the oneline summary of the commit we deemed to be the latest available for deployment. The `git checkout "$next"` command that is run just a couple lines up would also display this information if we didn't redirect it to /dev/null. However, it also produces other noisy output such as the "You are in detached HEAD state" message or "Leaving X commits behind" warning. Therefore, just summarize the commit ourselves. Signed-off-by: Malfurious <m@lfurio.us>
2023-08-18acid: Improve git error handlingMalfurious1-9/+11
Exit early from the cyche-source script on key git errors, where previously we would mindlessly continue on to execute a bunch of broken commands. Errors at this stage should be caught to prevent an attempt to build and deploy the code (even --force 'd builds). Signed-off-by: Malfurious <m@lfurio.us>
2023-08-08acid: Update check_sourceMalfurious1-8/+21
Script is renamed to 'cyche-source' and updated to account for a couple of potential edge-cases during a git update. Signed-off-by: Malfurious <m@lfurio.us>