Compare commits

...

6 commits

Author SHA1 Message Date
4e9afd7e5d
arch,readme
All checks were successful
/ job (push) Successful in 1m27s
2024-06-02 16:29:41 +02:00
1f5fe6900c
readme/git,default 2024-06-02 16:01:06 +02:00
8718ba1e57
cd_dns 2024-06-02 15:55:53 +02:00
5b3122aaf2
cd_git_parent 2024-06-02 15:50:44 +02:00
4be78a3d0e
cd_git_child 2024-06-02 15:46:36 +02:00
60b377e356
ssh 2024-06-02 15:43:45 +02:00
17 changed files with 40 additions and 41 deletions

View file

@ -5,7 +5,7 @@ jobs:
image: almalinux:8
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: almalinux:9
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: alpine:3.18
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: alpine:3.19
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: archlinux:base-20231112.0.191179
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: archlinux:base-20240101.0.204074
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: debian:bookworm
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: debian:bullseye
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: fedora:39
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: fedora:40
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: rockylinux:8
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: rockylinux:9
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: ubuntu:jammy
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -5,7 +5,7 @@ jobs:
image: ubuntu:noble
steps:
- name: cd
run: ${{vars.cd}} "${{secrets.cd_key}}" "${{vars.cd_hosts}}"
run: ${{vars.cd}} "${{secrets.cd_ssh_key}}" "${{vars.cd_ssh_hosts}}"
- run: cd-list-environment
- run: cd-clone-branch

View file

@ -1,7 +1,7 @@
image: debian:bookworm
job:
script:
- sh ${CD} "${CD_KEY}" "${CD_HOSTS}"
- sh ${CD} ${CD_SSH_KEY} ${CD_SSH_HOSTS}
- cd-list-environment
- cd-clone-branch

23
cd.sh
View file

@ -1,15 +1,11 @@
#! /usr/bin/env sh
# defaults
CD_DEFAULT_DNS="\
[ "${CD_DNS}" ] || CD_DNS="\
9.9.9.9 \
"
CD_PYTHON_MODULE="cd"
CD_PYTHON_MODULES="\
${CD_PYTHON_MODULE} \
rwx \
"
[ "${CD_GIT_CHILD}" ] || CD_GIT_CHILD="cd"
[ "${CD_GIT_PARENT}" ] || CD_GIT_PARENT="rwx"
# main
cd_main () {
@ -256,6 +252,9 @@ Dir::Etc::SourceParts \"\";
"${CD_OS_ALPINE}")
[ "${CD_URL_ALPINE}" ] && CD_URL_CHOSEN="${CD_URL_ALPINE}"
;;
"${CD_OS_ARCH}")
[ "${CD_URL_ARCH}" ] && CD_URL_CHOSEN="${CD_URL_ARCH}"
;;
"${CD_OS_DEBIAN}")
[ "${CD_URL_DEBIAN}" ] && CD_URL_CHOSEN="${CD_URL_DEBIAN}" \
|| CD_URL_CHOSEN="https://deb.debian.org/debian"
@ -444,11 +443,9 @@ cd_set_https_verification_off () {
cd_set_dns_resolving () {
local server
local servers
local text=""
cd_step "Set DNS resolving"
[ "${CD_DNS}" ] && servers="${CD_DNS}" || servers="${CD_DEFAULT_DNS}"
for server in ${servers} ; do
for server in ${CD_DNS} ; do
text="${text}nameserver ${server}
"
done
@ -540,7 +537,7 @@ local url
cd_step "Install Python modules"
root="$(mktemp --directory)" || exit
echo "${root}"
for repository in ${CD_PYTHON_MODULES} ; do
for repository in "${CD_GIT_CHILD}" "${CD_GIT_PARENT}" ; do
cd_split
url="${CD_PROJECTS_URL}/${repository}"
echo -n "\
@ -571,9 +568,9 @@ local self
echo -n "\
${self}
${CD_PYTHON_MODULE}
${CD_GIT_CHILD}
"
"${CD_PYTHON_ALIAS}" -m "${CD_PYTHON_MODULE}" "${@}"
"${CD_PYTHON_ALIAS}" -m "${CD_GIT_CHILD}" "${@}"
}
# functions

View file

@ -37,19 +37,21 @@ from various CA, CI, OCI / OS.
## How
| Variable | Description |
|:--------------|:------------------------|
| CD_CA_n | Numbered CA certificate |
| CD_DNS | Space separated servers |
| CD_SSH_HOSTS | domain.tld ssh-type pub |
| CD_SSH_TYPE | SSH private key type |
| CD_URL_ALMA | Alma repository URL |
| CD_URL_ALPINE | Alpine repository URL |
| CD_URL_ARCH | Arch repository URL |
| CD_URL_DEBIAN | Debian repository URL |
| CD_URL_FEDORA | Fedora repository URL |
| CD_URL_ROCKY | Rocky repository URL |
| CD_URL_UBUNTU | Ubuntu repository URL |
| Variable | Description | Default |
|:--------------|:------------------------|:--------------------------------|
| CD_CA_n | Numbered CA certificate | |
| CD_DNS | Space separated servers | 9.9.9.9 |
| CD_GIT_CHILD | Child Git repository | cd |
| CD_GIT_PARENT | Parent Git repository | rwx |
| CD_SSH_HOSTS | domain.tld ssh-type pub | |
| CD_SSH_KEY | SSH private key | |
| CD_URL_ALMA | Alma repository URL | https://repo.almalinux.org |
| CD_URL_ALPINE | Alpine repository URL | https://dl-cdn.alpinelinux.org |
| CD_URL_ARCH | Arch repository URL | https://geo.mirror.pkgbuild.com |
| CD_URL_DEBIAN | Debian repository URL | https://deb.debian.org |
| CD_URL_FEDORA | Fedora repository URL | https://rpmfind.net |
| CD_URL_ROCKY | Rocky repository URL | https://dl.rockylinux.org |
| CD_URL_UBUNTU | Ubuntu repository URL | https://ubuntu.mirrors.ovh.net |
## HTTPS & Python