Cesar Jhoanny Mendivil Rubio 697b7cc288
Some checks are pending
Container / meta (analyzer) (push) Waiting to run
Container / meta (api) (push) Waiting to run
Container / meta (legacy) (push) Waiting to run
Container / meta (nginx) (push) Waiting to run
Container / meta (playout) (push) Waiting to run
Container / meta (worker) (push) Waiting to run
Container / build (push) Blocked by required conditions
Project / pre-commit (push) Waiting to run
Project / test-tools (push) Waiting to run
Release-Please / release-please (push) Waiting to run
feat(easypanel): actualizar configuración y scripts de EasyPanel, incluyendo mejoras en la generación de contraseñas, sincronización de herramientas y gestión de configuraciones
2025-10-01 17:41:20 -07:00

27 lines
753 B
Bash
Executable File

#!/usr/bin/env bash
set -u
error() {
echo >&2 "error: $*"
exit 1
}
command -v git > /dev/null || error "git command not found!"
command -v tee > /dev/null || error "tee command not found!"
typeset -r version_file="VERSION"
if [[ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" == "true" ]]; then
tag=$(git tag --points-at HEAD | tee "$version_file" || error "could not extract tag")
if [[ -z "$tag" ]]; then
ref="${GITHUB_REF_NAME:-$(git rev-parse --abbrev-ref HEAD || error "could not extract ref")}"
sha="${GITHUB_SHA:-$(git rev-parse HEAD || error "could not extract commit sha")}"
echo "$ref-$sha" > "$version_file"
fi
else
if [[ ! -f "$version_file" ]]; then
echo "could not detect version" > VERSION
fi
fi