Compare commits

..

5 commits

Author SHA1 Message Date
dfa9fc1a7a
test
Some checks failed
/ arch (push) Successful in 2m47s
/ alpine (push) Successful in 1m48s
/ fedora (push) Successful in 12m27s
/ opensuse (push) Successful in 3m40s
/ alma (push) Successful in 12m13s
/ rocky (push) Successful in 13m41s
/ ubuntu (push) Successful in 5m38s
/ debian (push) Failing after 3m37s
2024-08-30 23:50:38 +02:00
278020cd6a
fix 2024-08-30 23:36:07 +02:00
da192ab113
python/simple 2024-08-30 23:34:11 +02:00
e705f46bda
language → locale 2024-08-30 22:57:57 +02:00
ede36e48a8
language → locale 2024-08-30 22:16:04 +02:00
4 changed files with 41 additions and 31 deletions

View file

@ -8,7 +8,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -24,7 +24,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -40,7 +40,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -56,7 +56,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -72,7 +72,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -88,7 +88,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -104,7 +104,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -120,7 +120,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project

View file

@ -8,7 +8,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -24,7 +24,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -40,7 +40,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -58,7 +58,7 @@ jobs:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_SSH_HOSTS: ${{vars.SPCD_SSH_HOSTS}} SPCD_SSH_HOSTS: ${{vars.SPCD_SSH_HOSTS}}
SPCD_SSH_KEY: ${{secrets.SPCD_SSH_KEY}} SPCD_SSH_KEY: ${{secrets.SPCD_SSH_KEY}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -75,7 +75,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -91,7 +91,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -107,7 +107,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project
@ -123,7 +123,7 @@ jobs:
- name: spcd - name: spcd
env: env:
SPCD: ${{vars.SPCD}} SPCD: ${{vars.SPCD}}
SPCD_TXT_LANGUAGE: ${{vars.SPCD_TXT_LANGUAGE}} SPCD_TXT_LOCALE: ${{vars.SPCD_TXT_LOCALE}}
run: ${{vars.SPCD}} run: ${{vars.SPCD}}
- run: spcd-check-project - run: spcd-check-project

View file

@ -135,6 +135,7 @@ Handle project workflows in a unified way:
| SPCD_REF_STAGING | Staging deployment ref | dev | | SPCD_REF_STAGING | Staging deployment ref | dev |
| SPCD_SSH_HOSTS | domain.tld ssh-type pub | | | SPCD_SSH_HOSTS | domain.tld ssh-type pub | |
| SPCD_SSH_KEY | SSH private key | | | SPCD_SSH_KEY | SSH private key | |
| SPCD_TXT_LOCALE | Locale to use for text | en_US |
| SPCD_URL_ALMA | Alma repository URL | https://repo.almalinux.org | | SPCD_URL_ALMA | Alma repository URL | https://repo.almalinux.org |
| SPCD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org | | SPCD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org |
| SPCD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com | | SPCD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com |

View file

@ -177,12 +177,12 @@ _spcd_step_wipe() {
# ╰───┴─────╯ # ╰───┴─────╯
_SPCD_TXT_CHARSET="UTF-8" _SPCD_TXT_CHARSET="UTF-8"
_SPCD_TXT_LANGUAGE_DEFAULT="C" _SPCD_TXT_LOCALE_DEFAULT="C"
_spcd_txt_pick() { _spcd_txt_pick() {
case "${SPCD_TXT_LANGUAGE}" in case "${SPCD_TXT_LOCALE}" in
"${SPCD_TXT_LANGUAGE_ENGLISH}") echo "${1}" ;; "${SPCD_TXT_LOCALE_ENGLISH}") echo "${1}" ;;
"${SPCD_TXT_LANGUAGE_FRENCH}") echo "${2}" ;; "${SPCD_TXT_LOCALE_FRENCH}") echo "${2}" ;;
*) ;; *) ;;
esac esac
} }
@ -322,8 +322,8 @@ spcd_step_out() {
# │ functions │ txt │ # │ functions │ txt │
# ╰───────────┴─────╯ # ╰───────────┴─────╯
SPCD_TXT_LANGUAGE_ENGLISH="en_US" SPCD_TXT_LOCALE_ENGLISH="en_US"
SPCD_TXT_LANGUAGE_FRENCH="fr_FR" SPCD_TXT_LOCALE_FRENCH="fr_FR"
spcd_txt_get() { spcd_txt_get() {
case "${1}" in case "${1}" in
@ -337,7 +337,7 @@ spcd_txt_locale() {
if [ -n "${1}" ]; then if [ -n "${1}" ]; then
spcd_step__locale__value="${1}" spcd_step__locale__value="${1}"
else else
spcd_step__locale__value="${_SPCD_TXT_LANGUAGE_DEFAULT}" spcd_step__locale__value="${_SPCD_TXT_LOCALE_DEFAULT}"
fi fi
spcd_step__locale__value="${spcd_step__locale__value}.${_SPCD_TXT_CHARSET}" spcd_step__locale__value="${spcd_step__locale__value}.${_SPCD_TXT_CHARSET}"
set -- \ set -- \
@ -397,7 +397,7 @@ spcd_step__environment_defaults_print() {
"REF_FEATURE" \ "REF_FEATURE" \
"REF_RELEASE" \ "REF_RELEASE" \
"REF_STAGING" \ "REF_STAGING" \
"TXT_LANGUAGE" \ "TXT_LOCALE" \
"URL_ALMA" \ "URL_ALMA" \
"URL_ALPINE" \ "URL_ALPINE" \
"URL_ARCH" \ "URL_ARCH" \
@ -432,8 +432,8 @@ spcd_step__environment_defaults_set() {
[ -n "${SPCD_REF_RELEASE}" ] || SPCD_REF_RELEASE="main" [ -n "${SPCD_REF_RELEASE}" ] || SPCD_REF_RELEASE="main"
[ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev" [ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev"
[ -n "${SPCD_TXT_LANGUAGE}" ] || [ -n "${SPCD_TXT_LOCALE}" ] ||
SPCD_TXT_LANGUAGE="${SPCD_TXT_LANGUAGE_ENGLISH}" SPCD_TXT_LOCALE="${SPCD_TXT_LOCALE_ENGLISH}"
[ -n "${SPCD_URL_ALMA}" ] || [ -n "${SPCD_URL_ALMA}" ] ||
# /almalinux/$releasever/… # /almalinux/$releasever/…
@ -464,7 +464,8 @@ spcd_step__environment_defaults_set() {
# /update/… # /update/…
SPCD_URL_OPENSUSE="https://download.opensuse.org" SPCD_URL_OPENSUSE="https://download.opensuse.org"
[ -n "${SPCD_URL_PYTHON}" ] || [ -n "${SPCD_URL_PYTHON}" ] ||
SPCD_URL_PYTHON="https://pypi.org/simple" # /simple
SPCD_URL_PYTHON="https://pypi.org"
[ -n "${SPCD_URL_ROCKY}" ] || [ -n "${SPCD_URL_ROCKY}" ] ||
# /$contentdir/$releasever/… # /$contentdir/$releasever/…
SPCD_URL_ROCKY="https://dl.rockylinux.org" SPCD_URL_ROCKY="https://dl.rockylinux.org"
@ -1162,8 +1163,8 @@ spcd_step__packages_verify_https() {
spcd_step__packages_install_locales() { spcd_step__packages_install_locales() {
spcd_step "Install locales" spcd_step "Install locales"
set -- \ set -- \
"${SPCD_TXT_LANGUAGE_ENGLISH}" \ "${SPCD_TXT_LOCALE_ENGLISH}" \
"${SPCD_TXT_LANGUAGE_FRENCH}" "${SPCD_TXT_LOCALE_FRENCH}"
case "${SPCD_PM}" in case "${SPCD_PM}" in
"${SPCD_PM_APK}") spcd_install_package "musl-locales" ;; "${SPCD_PM_APK}") spcd_install_package "musl-locales" ;;
"${SPCD_PM_APT}") "${SPCD_PM_APT}")
@ -1188,7 +1189,7 @@ ${spcd_step__pil__locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
"${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;; "${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;;
*) ;; *) ;;
esac esac
spcd_txt_locale "${SPCD_TXT_LANGUAGE}" spcd_txt_locale "${SPCD_TXT_LOCALE}"
} }
spcd_step__packages_upgrade_system() { spcd_step__packages_upgrade_system() {
@ -1234,7 +1235,7 @@ spcd_step__python_install() {
spcd_step "Configure PIP" spcd_step "Configure PIP"
spcd_os_write "/etc/pip.conf" "\ spcd_os_write "/etc/pip.conf" "\
[global] [global]
index-url = ${SPCD_URL_PYTHON} index-url = ${SPCD_URL_PYTHON}/simple
" "
spcd_step "Create" spcd_step "Create"
"${SPCD_PYTHON_ALIAS}" -m "venv" "${SPCD_PYTHON_VENV}" "${SPCD_PYTHON_ALIAS}" -m "venv" "${SPCD_PYTHON_VENV}"
@ -1384,7 +1385,15 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}"
# │ main │ # │ main │
# ╰──────╯ # ╰──────╯
spcd_test_local() {
local local_variable="KO!"
non_local_variable="OK"
}
spcd_main() { spcd_main() {
spcd_test_local
echo "local_variable = \"${local_variable}\""
echo "non_local_variable = \"${non_local_variable}\""
# environment # environment
spcd_txt_locale spcd_txt_locale
# #