Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
The output from build jobs are now stored in dedicated log files instead
of being dumped to stdout. Files are saved in the new volume at /logs
and intended to be accessed by the web interface for auditing there.
Files are named like "X_Y_Z.log" where X = a unique build number, Y = a
timestamp in UNIX epoch seconds, and Z = the corresponding service name.
Log files are simply closed when the job is finished, so the UI can
check for the existence of a file "/logs/active" which indicates that
the highest-numbered job is still in progress. This file is removed
afterward.
Failed jobs have a "JOB FAILED" message appended at the end of their
log. Successful jobs simply lack this message. One reason this is the
case is due to the build for cychedelic (--self) losing execution before
success can be affirmatively determined.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
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>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
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>
|
|
Per the previous two commits, the docker-compose.yml file is not needed
when running `docker compose down`. Update the cyche-remove script to
cope with a lack of such a file.
Also per the latest commit, arrange to always call docker compose with
the explicit --project-name.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
The script is refactored to always provide an explicit --project-name
option to docker compose. Still taken from the $CYCHE_SERVICES config
and only modified if --self is given.
This addresses an issue when using a docker-compose.yml from within a
subdirectory. If --project-name is omitted, the directory name used by
docker is the one containing the YML file, not the working directory
(git repository root).
When calling `docker compose down` (when given --self), we now omit the
--file as it is unnecessary.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
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>
|
|
If a service was previously managed by cychedelic, but an update to the
cyche code removes it from the config file, stop the service and delete
the git clone. As usual, this should leave any docker volumes intact.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
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>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
The loop in the main update function will sleep for a configurable
amount of time between each job / service entry.
This added time will make the output log easier to read on-the-fly, but
this change also makes the process of rapidly rebuilding services that
are dependent on each other more reliable.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
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>
|
|
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>
|
|
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>
|
|
Facilitate deployments using alternate docker-compose.yml files, or
projects which simply use a different filename for the configuration.
This setting populates the `docker compose -f` option.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
If cychedelic is ever started manually, using a pre-existing data
volume, the system will believe the previous instance is using a
specific random project name and may not properly shutdown the
user-initiated instance on a rebuild.
Simply attempting to stop the service using its default name will catch
this, and not cause any problems in the general case.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
The nested single quotes in these variables were not being interpreted
correctly at their usage locations (the quoted project name was being
sent to the docker cli). The quotes were initially wanted for the case
where there is not yet any previous_slug, as the command
"docker compose --project-name down" is ill-formed.
Since we know the actual slug values will not contain spaces, we can do
away with the quotes. Instead, prevent $prev from containing any
content in the special case described above. This is accomplished by
the conditional check [ -n "$prev" ].
Signed-off-by: Malfurious <m@lfurio.us>
|
|
The file will function as a service definition as well as the pseudo
cychedelic config file.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|
|
This is a merged version of a normal service builder and a cychedelic
self-builder.
Signed-off-by: Malfurious <m@lfurio.us>
|
|
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>
|
|
Signed-off-by: Malfurious <m@lfurio.us>
|