caddy/build.sh
pika 397cb4d4be
All checks were successful
Build and Push to Forgejo Registry / build (push) Successful in 7s
wip
2025-04-07 11:52:42 +02:00

67 lines
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
# ─< Check if the given command exists silently >─────────────────────────────────────────
command_exists() {
command -v "$@" >/dev/null 2>&1
}
# ─< ANSI color codes >───────────────────────────────────────────────────────────────────
RED='\033[0;31m'
CYAN='\033[0;36m'
YELLOW='\033[0;33m'
LIGHT_GREEN='\033[0;92m'
BOLD='\033[1m'
NC='\033[0m' # No Color
echo_error() {
printf "${BOLD}${RED}ERROR: ${NC}${RED}%s${NC}\n" "$1" >&2
}
echo_info() {
printf "${BOLD}${CYAN}INFO: ${NC}${CYAN}%s${NC}\n" "$1"
}
echo_warning() {
printf "${BOLD}${YELLOW}WARNING: ${NC}${YELLOW}%s${NC}\n" "$1"
}
echo_note() {
printf "${BOLD}${LIGHT_GREEN}NOTE: ${NC}${LIGHT_GREEN}%s${NC}\n" "$1"
}
image=docker/caddy
domain=git.k4li.de
tag=latest
container="${domain}/${image}:${tag}"
# if ! command_exists docker; then
# echo_error "Docker does not exist!"
# exit 1
# fi
#
# [[ ! -e ./Dockerfile ]] &&
# echo_error "Dockerfile does not exist" &&
# exit 1
#
# docker build -t "$container" .
#
# docker push "$container"
release="$(cat /etc/os-release)"
echo "Would push $container"
echo "is docker installed?"
if command_exists docker; then
echo "Yes!"
else
echo "No!"
fi
echo "What is the hostname? What is path?"
echo "HOSTNAME: $(hostname)"
echo "USER: $(whoami)"
echo "PATH: ${PATH}"
echo "IDS: $(id)"
echo "${release}"