Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion tool_docker-clean.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
#!/usr/bin/env sh
# tool_docker-clean.sh — Tear down the stack AND remove its named volumes.
#
# Use this when you want a fully clean SonarQube DB / data, e.g. after
# changing the plugin's rules / repository keys, or when recovering from
# a corrupted persistent volume.
#
# Auto-detects the container engine + compose flavor (Docker, Rancher
# Desktop, OrbStack, Colima, Podman, nerdctl, Finch). See
# `tool_lib_container.sh` for the override knobs (COMPOSE_CMD,
# CONTAINER_ENGINE_CMD, COMPOSE_VERBOSE).
set -eu

SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
. "$SCRIPT_DIR/tool_lib_container.sh"
cd "$SCRIPT_DIR"

printf '[creedengo-infra] stopping & removing volumes on %s via `%s`\n' \
"$CONTAINER_PRODUCT" "$COMPOSE"

# shellcheck disable=SC2086
$COMPOSE down --volumes

docker-compose down --volumes
18 changes: 17 additions & 1 deletion tool_docker-init.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
#!/usr/bin/env sh
# tool_docker-init.sh — Build images and start the local SonarQube stack.
#
# Auto-detects the container engine + compose flavor on this host (Docker
# Desktop, Rancher Desktop, OrbStack, Colima, Podman, nerdctl, Finch …).
# See `tool_lib_container.sh` for the full detection matrix and override
# environment variables (COMPOSE_CMD, CONTAINER_ENGINE_CMD, COMPOSE_VERBOSE).
set -eu

SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
. "$SCRIPT_DIR/tool_lib_container.sh"
cd "$SCRIPT_DIR"

printf '[creedengo-infra] starting stack on %s via `%s`\n' \
"$CONTAINER_PRODUCT" "$COMPOSE"

# shellcheck disable=SC2086 # $COMPOSE may contain spaces (e.g. "docker compose")
$COMPOSE up --build -d

docker-compose up --build -d
20 changes: 19 additions & 1 deletion tool_docker-logs.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#!/usr/bin/env sh
# tool_docker-logs.sh — Tail the stack logs (Sonar + Postgres).
#
# Pass extra args to scope to a single service, e.g. :
# ./tool_docker-logs.sh sonar
#
# Auto-detects the container engine + compose flavor (Docker, Rancher
# Desktop, OrbStack, Colima, Podman, nerdctl, Finch). See
# `tool_lib_container.sh` for the override knobs.
set -eu

SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
. "$SCRIPT_DIR/tool_lib_container.sh"
cd "$SCRIPT_DIR"

printf '[creedengo-infra] tailing logs on %s via `%s` (Ctrl+C to quit)\n' \
"$CONTAINER_PRODUCT" "$COMPOSE"

# shellcheck disable=SC2086
$COMPOSE logs -f "$@"

docker-compose logs -f
Loading