Files
dokku/plugins/builds/internal-functions
Jose Diaz-Gonzalez b3724716ff feat: implement build tracking
The DOKKU_PID now never gets overwritten except in the case that DOKKU is executed by the sudo user. If the command ends up executing a deploy, then the pid of the `dokku` owned process - which may have been executed via sudo - will be written to the file lock, allowing future commands to interact with the original process.

Additionally, the new builds plugin can be used to handle killing a build.
2025-11-22 20:34:40 -05:00

32 lines
850 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
fn-builds-help-content() {
declare desc="return logs plugin help content"
cat <<help_content
builds, Manage running builds
builds:cancel <app>, Cancel a running build for an app
builds:list <app>, List all running builds
builds:output <app>, Shows build output
builds:report [<app>] [<flag>], Displays a build report for one or more apps
help_content
}
cmd-builds-help() {
if [[ $1 == "builds:help" ]]; then
echo -e 'Usage: dokku builds[:COMMAND]'
echo ''
echo 'Manage running builds'
echo ''
echo 'Additional commands:'
fn-builds-help-content | sort | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
fn-builds-help-content
else
cat <<help_desc
builds, Manage running builds
help_desc
fi
}