From 22823e7edfcb019b91a81271c31d7eebb036366a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 27 Aug 2024 19:51:11 +0200 Subject: [PATCH] defaults --- spcd/bootstrap.sh | 75 +++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 10482e6..2f88598 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1,43 +1,5 @@ #! /usr/bin/env sh -# ╭──────────╮ -# │ defaults │ -# ╰──────────╯ - -[ -n "${SPCD_CMD_SUM}" ] || SPCD_CMD_SUM="sha512sum" - -[ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9" - -[ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd" -[ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx" - -[ -n "${SPCD_GIT_SHUNIT}" ] || SPCD_GIT_SHUNIT="shunit2" - -[ -n "${SPCD_REF_FEATURE}" ] || SPCD_REF_FEATURE="f" -[ -n "${SPCD_REF_RELEASE}" ] || SPCD_REF_RELEASE="main" -[ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev" - -[ -n "${SPCD_URL_ALMA}" ] || - SPCD_URL_ALMA="https://repo.almalinux.org" -[ -n "${SPCD_URL_ALPINE}" ] || - SPCD_URL_ALPINE="https://dl-cdn.alpinelinux.org/alpine" -[ -n "${SPCD_URL_ARCH}" ] || - SPCD_URL_ARCH="https://geo.mirror.pkgbuild.com/\$repo/os/\$arch" -[ -n "${SPCD_URL_DEBIAN}" ] || - SPCD_URL_DEBIAN="https://deb.debian.org/debian" -[ -n "${SPCD_URL_EPEL}" ] || - SPCD_URL_EPEL="https://dl.fedoraproject.org" -[ -n "${SPCD_URL_FEDORA}" ] || - SPCD_URL_FEDORA="https://rpmfind.net/linux/fedora/linux" -[ -n "${SPCD_URL_OPENSUSE}" ] || - SPCD_URL_OPENSUSE="https://download.opensuse.org" -[ -n "${SPCD_URL_PYTHON}" ] || - SPCD_URL_PYTHON="https://pypi.org/simple" -[ -n "${SPCD_URL_ROCKY}" ] || - SPCD_URL_ROCKY="https://dl.rockylinux.org" -[ -n "${SPCD_URL_UBUNTU}" ] || - SPCD_URL_UBUNTU="https://ubuntu.mirrors.ovh.net/ubuntu" - # ╭───╮ # │ _ │ # ╰───╯ @@ -643,6 +605,42 @@ ${SPCD_PYTHON_VENV}/lib/${SPCD_PYTHON_COMMAND}/site-packages" spcd_os_printenv "SPCD_DL" } +spcd_step__environment_defaults() { + [ -n "${SPCD_CMD_SUM}" ] || SPCD_CMD_SUM="sha512sum" + + [ -n "${SPCD_DNS_1}" ] || SPCD_DNS_1="9.9.9.9" + + [ -n "${SPCD_GIT_MAIN}" ] || SPCD_GIT_MAIN="spcd" + [ -n "${SPCD_GIT_ROOT}" ] || SPCD_GIT_ROOT="rwx" + + [ -n "${SPCD_GIT_SHUNIT}" ] || SPCD_GIT_SHUNIT="shunit2" + + [ -n "${SPCD_REF_FEATURE}" ] || SPCD_REF_FEATURE="f" + [ -n "${SPCD_REF_RELEASE}" ] || SPCD_REF_RELEASE="main" + [ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev" + + [ -n "${SPCD_URL_ALMA}" ] || + SPCD_URL_ALMA="https://repo.almalinux.org" + [ -n "${SPCD_URL_ALPINE}" ] || + SPCD_URL_ALPINE="https://dl-cdn.alpinelinux.org/alpine" + [ -n "${SPCD_URL_ARCH}" ] || + SPCD_URL_ARCH="https://geo.mirror.pkgbuild.com/\$repo/os/\$arch" + [ -n "${SPCD_URL_DEBIAN}" ] || + SPCD_URL_DEBIAN="https://deb.debian.org/debian" + [ -n "${SPCD_URL_EPEL}" ] || + SPCD_URL_EPEL="https://dl.fedoraproject.org" + [ -n "${SPCD_URL_FEDORA}" ] || + SPCD_URL_FEDORA="https://rpmfind.net/linux/fedora/linux" + [ -n "${SPCD_URL_OPENSUSE}" ] || + SPCD_URL_OPENSUSE="https://download.opensuse.org" + [ -n "${SPCD_URL_PYTHON}" ] || + SPCD_URL_PYTHON="https://pypi.org/simple" + [ -n "${SPCD_URL_ROCKY}" ] || + SPCD_URL_ROCKY="https://dl.rockylinux.org" + [ -n "${SPCD_URL_UBUNTU}" ] || + SPCD_URL_UBUNTU="https://ubuntu.mirrors.ovh.net/ubuntu" +} + spcd_step__environment_list_workspace() { spcd_step "List workspace" spcd_lwd__path="$(realpath .)" @@ -1221,6 +1219,7 @@ spcd_main() { # environment spcd_step_in "Environment" spcd_step__environment_set_variables + spcd_step__environment_defaults spcd_step__environment_list_workspace spcd_step_out # dns