From d19a657dac1c6098df0445928d32217110800a25 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 12:35:43 +0200 Subject: [PATCH 001/392] cd_cat --- cd.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cd.sh b/cd.sh index 2757fc5..15756bc 100644 --- a/cd.sh +++ b/cd.sh @@ -95,6 +95,7 @@ local text="" " done cd_write "${CD_DNS_FILE}" "${text}" + cd_cat "${CD_DNS_FILE}" } cd_set_packages_repositories () { @@ -246,6 +247,13 @@ cd_set_python_commands () { # +cd_cat () { + if [ -f "${1}" ] ; then + echo "$(realpath "${1}")" + cat "${1}" + fi +} + cd_install_package () { if [ "${1}" ] ; then case "${CD_OS_NAME}" in From e13563622fd3d4460bd0f8cfee02af9be9626819 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 12:44:28 +0200 Subject: [PATCH 002/392] env --- cd.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cd.sh b/cd.sh index 15756bc..e054636 100644 --- a/cd.sh +++ b/cd.sh @@ -29,6 +29,7 @@ cd_main () { cd_set_environment () { cd_step "Set environment" CD_DNS_FILE="/etc/resolv.conf" + # case "${CD_OS_NAME}" in "debian") CD_PYTHON_COMMAND="python3" @@ -84,6 +85,22 @@ cd_set_environment () { fi # project / url CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" + # + echo -n "\ +CD_OS_NAME=${CD_OS_NAME} +CD_OS_VERSION=${CD_OS_VERSION} +# +CD_DNS_FILE=${CD_DNS_FILE} +# +CD_PYTHON_COMMAND=${CD_PYTHON_COMMAND} +CD_PYTHON_PACKAGES=${CD_PYTHON_PACKAGES} +# +CD_PROJECT_BRANCH=${CD_PROJECT_BRANCH} +CD_PROJECT_NAME=${CD_PROJECT_NAME} +CD_PROJECT_URL=${CD_PROJECT_URL} +CD_PROJECTS_GROUP=${CD_PROJECTS_GROUP} +CD_PROJECTS_URL=${CD_PROJECTS_URL} +" } cd_set_dns_resolving () { From 7cfd0247f0ccef6e4e52f08bf6830d2b1ce2ac3c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 13:00:18 +0200 Subject: [PATCH 003/392] cd_rm --- cd.sh | 19 +++++++++++++++---- cd/__init__.py | 1 + 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index e054636..9af0f96 100644 --- a/cd.sh +++ b/cd.sh @@ -125,6 +125,7 @@ deb https://deb.debian.org/debian bookworm-backports main deb https://deb.debian.org/debian bookworm-updates main deb https://deb.debian.org/debian-security bookworm-security main " + cd_cat "/etc/apt/sources.list" ;; *) exit 1 ;; esac @@ -142,6 +143,7 @@ APT::Install-Recommends False; APT::Install-Suggests False; Dir::Etc::SourceParts \"\"; " + cd_cat "/etc/apt/apt.conf.d/apt.conf" ;; *) exit 1 ;; esac @@ -154,6 +156,7 @@ cd_set_https_verification_off () { cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; " + cd_cat "/etc/apt/apt.conf.d/https" ;; *) exit 1 ;; esac @@ -196,7 +199,7 @@ local target cd_update_ca () { cd_step "Update CA" case "${CD_OS_NAME}" in - "debian") update-ca-certificates ;; + "debian") update-ca-certificates || exit ;; *) exit 1 ;; esac } @@ -204,7 +207,7 @@ cd_update_ca () { cd_set_https_verification_on () { cd_step "Set HTTPS verification on" case "${CD_OS_NAME}" in - "debian") rm "/etc/apt/apt.conf.d/https" ;; + "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; *) exit 1 ;; esac } @@ -247,6 +250,7 @@ local root cd_step "Clone parent repositories" root="$(mktemp --directory)" || exit for repository in "${@}" ; do + echo "${repository}" git clone \ "${CD_PROJECTS_URL}/${repository}" "${root}/${repository}" \ || exit @@ -266,8 +270,8 @@ cd_set_python_commands () { cd_cat () { if [ -f "${1}" ] ; then - echo "$(realpath "${1}")" - cat "${1}" + echo "↗$(realpath "${1}")" + cat "${1}" || exit fi } @@ -280,6 +284,13 @@ cd_install_package () { fi } +cd_rm () { + if [ -f "${1}" ] ; then + echo "×$(realpath "${1}")" + rm "${1}" || exit + fi +} + cd_step () { if [ "${1}" ] ; then CD_STEP=$((CD_STEP+1)) diff --git a/cd/__init__.py b/cd/__init__.py index d2b4385..f1fce8a 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -31,4 +31,5 @@ def install_commands(path): 'clone-branch', 'list-environment', ]: + print(command) os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}')) From bd6cb1ce632be5f4fb6fe5ae005c2cfa9e2d31ed Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 15:42:36 +0200 Subject: [PATCH 004/392] exit --- cd.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index 9af0f96..ce18d2c 100644 --- a/cd.sh +++ b/cd.sh @@ -21,7 +21,7 @@ cd_main () { cd_install_python cd_clean_packages_cache cd_clone_parent_repositories "${@}" - cd_set_python_commands "${@}" + cd_execute_python_module "${@}" } # @@ -261,16 +261,23 @@ local root rm --force --recursive "${root}" || exit } -cd_set_python_commands () { +cd_execute_python_module () { +local self cd_step "Set Python commands" - "${CD_PYTHON_COMMAND}" -m "${1}" + self="$(realpath "${0}")" + echo -n "\ +${self} +↓ +${1} +" + "${CD_PYTHON_COMMAND}" -m "${1}" "${self}" } # cd_cat () { if [ -f "${1}" ] ; then - echo "↗$(realpath "${1}")" + echo "⋅$(realpath "${1}")" cat "${1}" || exit fi } @@ -286,7 +293,7 @@ cd_install_package () { cd_rm () { if [ -f "${1}" ] ; then - echo "×$(realpath "${1}")" + echo "× $(realpath "${1}")" rm "${1}" || exit fi } From bcf5b27c246298ec93ad42c01c01e837e2c1c091 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 16:27:02 +0200 Subject: [PATCH 005/392] workflow --- .forgejo/workflows/main.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index 7bc4877..bd3d2d3 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -1,7 +1,22 @@ on: [push] jobs: job: - runs-on: bookworm + container: + image: debian:bookworm steps: - name: cd - run: eval '${{vars.cd}}' + env: + CD: ${{secrets.cd}} + CD_OS_NAME: debian + CD_OS_VERSION: bookworm + run: eval ${{vars.cd}} + + - run: cd-list-environment + + - run: cd-clone-branch + - run: cd-install-packages pandoc + + - run: cd-build-project + - run: cd-browse-workspace + + - run: cd-synchronize out From 3d01f8157ebdbce0416cff995cd127f89e6a24fa Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 17:49:06 +0200 Subject: [PATCH 006/392] fixes --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index ce18d2c..d9b0cbb 100644 --- a/cd.sh +++ b/cd.sh @@ -263,14 +263,14 @@ local root cd_execute_python_module () { local self - cd_step "Set Python commands" + cd_step "Execute Python module" self="$(realpath "${0}")" echo -n "\ ${self} ↓ ${1} " - "${CD_PYTHON_COMMAND}" -m "${1}" "${self}" + "${CD_PYTHON_COMMAND}" -m "${1}" "${CD_STEP}" "${self}" } # From e95f3f012e06330f356e02414d7bb3366666a4e0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 18:07:24 +0200 Subject: [PATCH 007/392] workflow --- .forgejo/workflows/main.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index bd3d2d3..372c58c 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -12,11 +12,7 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment - - run: cd-clone-branch - - run: cd-install-packages pandoc - - - run: cd-build-project - run: cd-browse-workspace - + - run: cd-build-project - run: cd-synchronize out From 0459ddfbf176bc23c3d8fca506114bb3bb6d834e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 18:10:50 +0200 Subject: [PATCH 008/392] os.curdir --- cd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index f1fce8a..462453b 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -16,7 +16,7 @@ def cd_clone_branch(): '--branch', project.branch, '--', project.url, - '.', + os.curdir, ) From d9a345010c74051a2742d3fa6d11066654c3c7ca Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 18:12:30 +0200 Subject: [PATCH 009/392] =?UTF-8?q?=E2=88=92install-packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/cd-install-packages.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100755 cmd/cd-install-packages.sh diff --git a/cmd/cd-install-packages.sh b/cmd/cd-install-packages.sh deleted file mode 100755 index af6eefc..0000000 --- a/cmd/cd-install-packages.sh +++ /dev/null @@ -1 +0,0 @@ -apt-get install --yes "${@}" From 283cc5ef809efea5f54f0ba4cf317c9ac84d02a0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 18:36:34 +0200 Subject: [PATCH 010/392] clone_branch --- cd/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cd/__init__.py b/cd/__init__.py index 462453b..7605d85 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -11,6 +11,11 @@ project = Project(projects) def cd_clone_branch(): + print(f'''\ +{project.url} +↓ +{os.path.realpath(os.curdir)} +''') ps.run('git', 'clone', '--branch', project.branch, From dd90f51e3711714ec17afe4fe23f70d292246fb5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 18:40:31 +0200 Subject: [PATCH 011/392] end,flush --- cd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index 7605d85..f2edb61 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -15,7 +15,7 @@ def cd_clone_branch(): {project.url} ↓ {os.path.realpath(os.curdir)} -''') +''', end=str(), flush=True) ps.run('git', 'clone', '--branch', project.branch, From 3211cbea65119007ad22c254320a62d0f9b0b8d4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 18:48:01 +0200 Subject: [PATCH 012/392] fix --- cd/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index f2edb61..5fc2a66 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -14,14 +14,13 @@ def cd_clone_branch(): print(f'''\ {project.url} ↓ -{os.path.realpath(os.curdir)} ''', end=str(), flush=True) ps.run('git', 'clone', '--branch', project.branch, '--', project.url, - os.curdir, + os.path.realpath(os.curdir), ) From d7da843781d1a7896dedadbdd15b801cfdcb2c57 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 20:47:38 +0200 Subject: [PATCH 013/392] gitlab-ci --- .gitlab-ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..064da2e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,6 @@ +image: debian:bookworm + +job: + script: + - source ${CD} + - cd-list-environment From 764cda2ac5a0ad7cc7a2e87e3e7b5319b542336b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 21:17:29 +0200 Subject: [PATCH 014/392] gitlab/eval --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 064da2e..c7abba7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,5 +2,5 @@ image: debian:bookworm job: script: - - source ${CD} + - eval ${CD} - cd-list-environment From 7f82ad84fce9c54195d88955325373318d4d3ba3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 21:19:42 +0200 Subject: [PATCH 015/392] gitlab/quotes --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7abba7..dd1f5d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,5 +2,5 @@ image: debian:bookworm job: script: - - eval ${CD} + - eval "${CD}" - cd-list-environment From 0e5f5b5f5dab180a10e9fac88efa32746d7ba3f8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 21:25:42 +0200 Subject: [PATCH 016/392] gitlab/os --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dd1f5d1..3f7f2e5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,9 @@ image: debian:bookworm job: + variables: + CD_OS_NAME: debian + CD_OS_VERSION: bookworm script: - eval "${CD}" - cd-list-environment From d1aff3818927adbb3a05cbdd4516aa1c35d39dfe Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 21:28:43 +0200 Subject: [PATCH 017/392] gitlab/source --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f7f2e5..ee0ff00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,5 +5,5 @@ job: CD_OS_NAME: debian CD_OS_VERSION: bookworm script: - - eval "${CD}" + - source ${CD} - cd-list-environment From 141cba1fdb2e04e0632aaabf5741ccf58601cf3b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 21:53:01 +0200 Subject: [PATCH 018/392] gitlab/steps --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee0ff00..3618c8c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,3 +7,7 @@ job: script: - source ${CD} - cd-list-environment + - cd-clone-branch + - cd-browse-workspace + - cd-build-project + - cd-synchronize out From ea2247d3f9e8f67fe5724ee9cdd29e0349a0f20d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 21:56:27 +0200 Subject: [PATCH 019/392] pwd,ls --- .forgejo/workflows/main.yaml | 1 + .gitlab-ci.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index 372c58c..aa1629a 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -4,6 +4,7 @@ jobs: container: image: debian:bookworm steps: + - run: pwd && ls -a -l - name: cd env: CD: ${{secrets.cd}} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3618c8c..fe266b8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ job: CD_OS_NAME: debian CD_OS_VERSION: bookworm script: + - pwd && ls -a -l - source ${CD} - cd-list-environment - cd-clone-branch From 44afb1bf466575877f3e9448e9d4b98d057635f2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 23:29:31 +0200 Subject: [PATCH 020/392] install_python_modules --- cd.sh | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/cd.sh b/cd.sh index d9b0cbb..8f67468 100644 --- a/cd.sh +++ b/cd.sh @@ -20,7 +20,7 @@ cd_main () { cd_install_git cd_install_python cd_clean_packages_cache - cd_clone_parent_repositories "${@}" + cd_install_python_modules "${@}" cd_execute_python_module "${@}" } @@ -244,21 +244,33 @@ cd_clean_packages_cache () { esac } -cd_clone_parent_repositories () { +cd_install_python_modules () { +local path local repository local root - cd_step "Clone parent repositories" +local url + cd_step "Install Python modules" root="$(mktemp --directory)" || exit for repository in "${@}" ; do - echo "${repository}" + url="${CD_PROJECTS_URL}/${repository}" + echo -n " +${url} +↓ +" git clone \ - "${CD_PROJECTS_URL}/${repository}" "${root}/${repository}" \ + "${url}" "${root}/${repository}" \ || exit + path="${root}/${repository}/${repository}" + echo -n "\ +${path} +↓ +${CD_PYTHON_PACKAGES} +" cp --recursive \ - "${root}/${repository}/${repository}" "${CD_PYTHON_PACKAGES}" \ + "${path}" "${CD_PYTHON_PACKAGES}" \ || exit done - rm --force --recursive "${root}" || exit + cd_rm "${root}" } cd_execute_python_module () { @@ -292,9 +304,9 @@ cd_install_package () { } cd_rm () { - if [ -f "${1}" ] ; then + if [ -e "${1}" ] ; then echo "× $(realpath "${1}")" - rm "${1}" || exit + rm --recursive "${1}" || exit fi } From ed646f6c719fa8d386839af9e82b17b7f85e3055 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 28 Apr 2024 23:41:12 +0200 Subject: [PATCH 021/392] root --- cd.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 8f67468..7a49275 100644 --- a/cd.sh +++ b/cd.sh @@ -251,6 +251,7 @@ local root local url cd_step "Install Python modules" root="$(mktemp --directory)" || exit + echo "${root}" for repository in "${@}" ; do url="${CD_PROJECTS_URL}/${repository}" echo -n " @@ -313,8 +314,10 @@ cd_rm () { cd_step () { if [ "${1}" ] ; then CD_STEP=$((CD_STEP+1)) - echo " + echo "\ +\\ ${CD_STEP} ${1} +/ " fi } From 64ed4186b3f3390226030e90b7a74f6b6d219ce8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 10:58:37 +0200 Subject: [PATCH 022/392] refactor --- cd.sh | 57 ++++++++++++++++++++++++--------------------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/cd.sh b/cd.sh index 7a49275..fa39bf9 100644 --- a/cd.sh +++ b/cd.sh @@ -49,41 +49,30 @@ cd_set_environment () { exit 1 ;; esac - # project / branch - [ "${CI_COMMIT_BRANCH}" ] && CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" - [ "${GITHUB_REF_NAME}" ] && CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" - if [ ! "${CD_PROJECT_BRANCH}" ] ; then - echo "CD_PROJECT_BRANCH" - exit 3 - fi - # project / name - [ "${CI_PROJECT_PATH}" ] \ - && CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" - [ "${GITHUB_REPOSITORY}" ] \ - && CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" - if [ ! "${CD_PROJECT_NAME}" ] ; then - echo "CD_PROJECT_NAME" - exit 3 - fi - # projects / group - [ "${CI_PROJECT_PATH}" ] \ - && CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" - [ "${GITHUB_REPOSITORY}" ] \ - && CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" - if [ ! "${CD_PROJECTS_GROUP}" ] ; then - echo "CD_PROJECTS_GROUP" - exit 3 - fi - # projects / url - [ "${CI_SERVER_URL}" ] && CD_PROJECTS_URL="${CI_SERVER_URL}" - [ "${GITHUB_SERVER_URL}" ] && CD_PROJECTS_URL="${GITHUB_SERVER_URL}" - if [ "${CD_PROJECTS_URL}" ] ; then - CD_PROJECTS_URL="${CD_PROJECTS_URL}/${CD_PROJECTS_GROUP}" + # ci / github + if [ "${GITHUB_ACTIONS}" ] ; then + CD_SERVER_URL="${GITHUB_SERVER_URL}" + CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" + CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" + CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" + # ci / gitlab + elif [ "${GITLAB_CI}" ] ; then + CD_SERVER_URL="${CI_SERVER_URL}" + CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" + CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" + CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" + # ci / none else - echo "CD_PROJECTS_URL" + echo "CI" exit 3 fi - # project / url + # + [ "${CD_SERVER_URL}" ] || echo "CD_SERVER_URL" && exit 3 + [ "${CD_PROJECT_BRANCH}" ] || echo "CD_PROJECT_BRANCH" && exit 3 + [ "${CD_PROJECT_NAME}" ] || echo "CD_PROJECT_NAME" && exit 3 + [ "${CD_PROJECTS_GROUP}" ] || echo "CD_PROJECTS_GROUP" && exit 3 + # + CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # echo -n "\ @@ -95,11 +84,13 @@ CD_DNS_FILE=${CD_DNS_FILE} CD_PYTHON_COMMAND=${CD_PYTHON_COMMAND} CD_PYTHON_PACKAGES=${CD_PYTHON_PACKAGES} # +CD_SERVER_URL=${CD_SERVER_URL} CD_PROJECT_BRANCH=${CD_PROJECT_BRANCH} CD_PROJECT_NAME=${CD_PROJECT_NAME} -CD_PROJECT_URL=${CD_PROJECT_URL} CD_PROJECTS_GROUP=${CD_PROJECTS_GROUP} +# CD_PROJECTS_URL=${CD_PROJECTS_URL} +CD_PROJECT_URL=${CD_PROJECT_URL} " } From c114dfae779cb34899c877a450a0013d25077523 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 11:01:48 +0200 Subject: [PATCH 023/392] error_ci,error_os --- cd.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cd.sh b/cd.sh index fa39bf9..23c74a8 100644 --- a/cd.sh +++ b/cd.sh @@ -286,6 +286,15 @@ cd_cat () { fi } +cd_error_ci () { + echo "× CI: ${1}" + exit 1 +} +cd_error_os () { + echo "× OS: ${1}" + exit 2 +} + cd_install_package () { if [ "${1}" ] ; then case "${CD_OS_NAME}" in From de5f67bb9b59a9e6ff981e6ce02c521f2c2c6dcb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 11:08:29 +0200 Subject: [PATCH 024/392] error_ci --- cd.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 23c74a8..a85860c 100644 --- a/cd.sh +++ b/cd.sh @@ -63,14 +63,13 @@ cd_set_environment () { CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" # ci / none else - echo "CI" - exit 3 + cd_error_ci "ø" fi # - [ "${CD_SERVER_URL}" ] || echo "CD_SERVER_URL" && exit 3 - [ "${CD_PROJECT_BRANCH}" ] || echo "CD_PROJECT_BRANCH" && exit 3 - [ "${CD_PROJECT_NAME}" ] || echo "CD_PROJECT_NAME" && exit 3 - [ "${CD_PROJECTS_GROUP}" ] || echo "CD_PROJECTS_GROUP" && exit 3 + [ "${CD_SERVER_URL}" ] || cd_error_ci "CD_SERVER_URL" + [ "${CD_PROJECT_BRANCH}" ] || cd_error_ci "CD_PROJECT_BRANCH" + [ "${CD_PROJECT_NAME}" ] || cd_error_ci "CD_PROJECT_NAME" + [ "${CD_PROJECTS_GROUP}" ] || cd_error_ci "CD_PROJECTS_GROUP" # CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" From 4ed8c776d4323de6a5cac406dbec355b3010c7d8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 11:42:11 +0200 Subject: [PATCH 025/392] error_os --- cd.sh | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/cd.sh b/cd.sh index a85860c..06ab309 100644 --- a/cd.sh +++ b/cd.sh @@ -38,16 +38,10 @@ cd_set_environment () { "bookworm") echo "TODO" ;; - *) - echo "CD_OS_VERSION" - exit 2 - ;; + *) cd_error_os "CD_OS_VERSION=" ;; esac ;; - *) - echo "CD_OS_NAME" - exit 1 - ;; + *) cd_error_os "CD_OS_NAME=" ;; esac # ci / github if [ "${GITHUB_ACTIONS}" ] ; then @@ -117,7 +111,7 @@ deb https://deb.debian.org/debian-security bookworm-security main " cd_cat "/etc/apt/sources.list" ;; - *) exit 1 ;; + *) cd_error_os "cd_set_packages_repositories" ;; esac } @@ -135,7 +129,7 @@ Dir::Etc::SourceParts \"\"; " cd_cat "/etc/apt/apt.conf.d/apt.conf" ;; - *) exit 1 ;; + *) cd_error_os "cd_set_packages_configuration" ;; esac } @@ -148,7 +142,7 @@ Acquire::https::Verify-Peer False; " cd_cat "/etc/apt/apt.conf.d/https" ;; - *) exit 1 ;; + *) cd_error_os "cd_set_https_verification_off" ;; esac } @@ -156,7 +150,7 @@ cd_update_packages_catalog () { cd_step "Update packages catalog" case "${CD_OS_NAME}" in "debian") apt-get update || exit ;; - *) exit 1 ;; + *) cd_error_os "cd_update_packages_catalog" ;; esac } @@ -164,7 +158,7 @@ cd_install_packages_tools () { cd_step "Install packages tools" case "${CD_OS_NAME}" in "debian") cd_install_package "apt-utils" ;; - *) exit 1 ;; + *) cd_error_os "cd_install_packages_tools" ;; esac } @@ -172,7 +166,7 @@ cd_install_ca () { cd_step "Install CA" case "${CD_OS_NAME}" in "debian") cd_install_package "ca-certificates" ;; - *) exit 1 ;; + *) cd_error_os "cd_install_ca" ;; esac } @@ -181,7 +175,7 @@ local target cd_step "Copy CA" case "${CD_OS_NAME}" in "debian") target="/usr/local/share/ca-certificates" ;; - *) exit 1 ;; + *) cd_error_os "cd_copy_ca" ;; esac # TODO copy } @@ -190,7 +184,7 @@ cd_update_ca () { cd_step "Update CA" case "${CD_OS_NAME}" in "debian") update-ca-certificates || exit ;; - *) exit 1 ;; + *) cd_error_os "cd_update_ca" ;; esac } @@ -198,7 +192,7 @@ cd_set_https_verification_on () { cd_step "Set HTTPS verification on" case "${CD_OS_NAME}" in "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; - *) exit 1 ;; + *) cd_error_os "cd_set_https_verification_on" ;; esac } @@ -206,7 +200,7 @@ cd_upgrade_packages () { cd_step "Upgrade packages" case "${CD_OS_NAME}" in "debian") apt-get upgrade --yes || exit ;; - *) exit 1 ;; + *) cd_error_os "cd_upgrade_packages" ;; esac } @@ -214,7 +208,7 @@ cd_install_git () { cd_step "Install Git" case "${CD_OS_NAME}" in "debian") cd_install_package "git" ;; - *) exit 1 ;; + *) cd_error_os "cd_install_git" ;; esac } @@ -222,7 +216,7 @@ cd_install_python () { cd_step "Install Python" case "${CD_OS_NAME}" in "debian") cd_install_package "python3" ;; - *) exit 1 ;; + *) cd_error_os "cd_install_python" ;; esac } @@ -230,7 +224,7 @@ cd_clean_packages_cache () { cd_step "Clean packages cache" case "${CD_OS_NAME}" in "debian") apt-get clean || exit ;; - *) exit 1 ;; + *) cd_error_os "cd_clean_packages_cache" ;; esac } From 724f28d17fb670d04fb20a72cf79de54be0d57ea Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 12:15:49 +0200 Subject: [PATCH 026/392] order --- cd.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 06ab309..01aab9c 100644 --- a/cd.sh +++ b/cd.sh @@ -46,24 +46,24 @@ cd_set_environment () { # ci / github if [ "${GITHUB_ACTIONS}" ] ; then CD_SERVER_URL="${GITHUB_SERVER_URL}" - CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" - CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" + CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" + CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" # ci / gitlab elif [ "${GITLAB_CI}" ] ; then CD_SERVER_URL="${CI_SERVER_URL}" - CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" - CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" + CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" + CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" # ci / none else cd_error_ci "ø" fi # [ "${CD_SERVER_URL}" ] || cd_error_ci "CD_SERVER_URL" - [ "${CD_PROJECT_BRANCH}" ] || cd_error_ci "CD_PROJECT_BRANCH" - [ "${CD_PROJECT_NAME}" ] || cd_error_ci "CD_PROJECT_NAME" [ "${CD_PROJECTS_GROUP}" ] || cd_error_ci "CD_PROJECTS_GROUP" + [ "${CD_PROJECT_NAME}" ] || cd_error_ci "CD_PROJECT_NAME" + [ "${CD_PROJECT_BRANCH}" ] || cd_error_ci "CD_PROJECT_BRANCH" # CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" @@ -78,9 +78,9 @@ CD_PYTHON_COMMAND=${CD_PYTHON_COMMAND} CD_PYTHON_PACKAGES=${CD_PYTHON_PACKAGES} # CD_SERVER_URL=${CD_SERVER_URL} -CD_PROJECT_BRANCH=${CD_PROJECT_BRANCH} -CD_PROJECT_NAME=${CD_PROJECT_NAME} CD_PROJECTS_GROUP=${CD_PROJECTS_GROUP} +CD_PROJECT_NAME=${CD_PROJECT_NAME} +CD_PROJECT_BRANCH=${CD_PROJECT_BRANCH} # CD_PROJECTS_URL=${CD_PROJECTS_URL} CD_PROJECT_URL=${CD_PROJECT_URL} From c3e6ec5a3473837761f4f082d369e43240a28e95 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 12:23:22 +0200 Subject: [PATCH 027/392] step --- cd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 01aab9c..47b42f2 100644 --- a/cd.sh +++ b/cd.sh @@ -308,9 +308,9 @@ cd_step () { if [ "${1}" ] ; then CD_STEP=$((CD_STEP+1)) echo "\ -\\ - ${CD_STEP} ${1} -/ +╭─┄┈ +│ ${CD_STEP} ${1} +╰─┄┈ " fi } From 4dbf04fb108bc42eda04d662ec75a3d3d81bf9ae Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 12:26:45 +0200 Subject: [PATCH 028/392] horizontal --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 47b42f2..ea77f6d 100644 --- a/cd.sh +++ b/cd.sh @@ -308,9 +308,9 @@ cd_step () { if [ "${1}" ] ; then CD_STEP=$((CD_STEP+1)) echo "\ -╭─┄┈ +╭─╌┄┈ │ ${CD_STEP} ${1} -╰─┄┈ +╰─╌┄┈ " fi } From f51e89ee795515a811b1c019da87f42586b8525e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 12:43:22 +0200 Subject: [PATCH 029/392] sections --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index ea77f6d..6f19a47 100644 --- a/cd.sh +++ b/cd.sh @@ -1,7 +1,9 @@ #! /usr/bin/env sh +# modules set "cd" "rwx" +# steps cd_main () { cd_set_environment cd_set_dns_resolving \ @@ -24,7 +26,7 @@ cd_main () { cd_execute_python_module "${@}" } -# +# functions cd_set_environment () { cd_step "Set environment" @@ -270,7 +272,7 @@ ${1} "${CD_PYTHON_COMMAND}" -m "${1}" "${CD_STEP}" "${self}" } -# +# tools cd_cat () { if [ -f "${1}" ] ; then @@ -325,6 +327,5 @@ local text="${2}" fi } -# - +# main cd_main "${@}" From 966f40065208ab5e0fb17c4ffa9a319836fb8d10 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 12:45:57 +0200 Subject: [PATCH 030/392] cd_cat --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 6f19a47..a24b913 100644 --- a/cd.sh +++ b/cd.sh @@ -276,7 +276,7 @@ ${1} cd_cat () { if [ -f "${1}" ] ; then - echo "⋅$(realpath "${1}")" + echo "╭$(realpath "${1}")" cat "${1}" || exit fi } From 63b862cdd1d61ff0d20b46ed05c7171c6eb172d4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 12:51:48 +0200 Subject: [PATCH 031/392] cd_step --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index a24b913..b31afb0 100644 --- a/cd.sh +++ b/cd.sh @@ -309,7 +309,7 @@ cd_rm () { cd_step () { if [ "${1}" ] ; then CD_STEP=$((CD_STEP+1)) - echo "\ + echo -n "\ ╭─╌┄┈ │ ${CD_STEP} ${1} ╰─╌┄┈ From 9ab60f5b5651bc6e736c604430a29759e371d371 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 13:04:36 +0200 Subject: [PATCH 032/392] readme --- readme.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..95f9c4b --- /dev/null +++ b/readme.md @@ -0,0 +1,14 @@ +# Continuous Deployment + +## Features + +* [ ] detect + * [ ] OS name + * [ ] OS version +* [X] handle CI platforms + * [X] ForgeJo / Gitea / GitHub + * [X] GitLab + +## Tasks + +* use constants for OS names From 4e10aef6a9a70a3d7e686bdd7bb38b8afc442fd4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 15:10:51 +0200 Subject: [PATCH 033/392] cd_dns --- cd.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index b31afb0..7a780e3 100644 --- a/cd.sh +++ b/cd.sh @@ -1,13 +1,15 @@ #! /usr/bin/env sh +[ "${CD_DNS}" ] || CD_DNS="\ +9.9.9.9 \ +" # modules set "cd" "rwx" # steps cd_main () { cd_set_environment - cd_set_dns_resolving \ - "9.9.9.9" + cd_set_dns_resolving ${CD_DNS} cd_set_packages_repositories cd_set_packages_configuration cd_set_https_verification_off From bf32e90fe5ac63474ae36471056d68b8cdda78a4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 15:14:49 +0200 Subject: [PATCH 034/392] cd_python_modules --- cd.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index 7a780e3..b5ddf8d 100644 --- a/cd.sh +++ b/cd.sh @@ -3,8 +3,10 @@ [ "${CD_DNS}" ] || CD_DNS="\ 9.9.9.9 \ " -# modules -set "cd" "rwx" +CD_PYTHON_MODULES="\ +cd \ +rwx \ +" # steps cd_main () { @@ -24,8 +26,8 @@ cd_main () { cd_install_git cd_install_python cd_clean_packages_cache - cd_install_python_modules "${@}" - cd_execute_python_module "${@}" + cd_install_python_modules ${CD_PYTHON_MODULES} + cd_execute_python_module ${CD_PYTHON_MODULES} } # functions @@ -330,4 +332,4 @@ local text="${2}" } # main -cd_main "${@}" +cd_main From 5f661ba6dba3b680da537fbd53486dbc8d56ebd9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 16:21:31 +0200 Subject: [PATCH 035/392] makecache --- cd.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index b5ddf8d..3846d43 100644 --- a/cd.sh +++ b/cd.sh @@ -41,12 +41,11 @@ cd_set_environment () { CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" case "${CD_OS_VERSION}" in - "bookworm") - echo "TODO" - ;; + "bookworm") echo "TODO" ;; *) cd_error_os "CD_OS_VERSION=" ;; esac ;; + "alma") echo "TODO" ;; *) cd_error_os "CD_OS_NAME=" ;; esac # ci / github @@ -117,6 +116,7 @@ deb https://deb.debian.org/debian-security bookworm-security main " cd_cat "/etc/apt/sources.list" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_set_packages_repositories" ;; esac } @@ -135,6 +135,7 @@ Dir::Etc::SourceParts \"\"; " cd_cat "/etc/apt/apt.conf.d/apt.conf" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_set_packages_configuration" ;; esac } @@ -148,6 +149,7 @@ Acquire::https::Verify-Peer False; " cd_cat "/etc/apt/apt.conf.d/https" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_set_https_verification_off" ;; esac } @@ -156,6 +158,7 @@ cd_update_packages_catalog () { cd_step "Update packages catalog" case "${CD_OS_NAME}" in "debian") apt-get update || exit ;; + "alma") dnf makecache || exit ;; *) cd_error_os "cd_update_packages_catalog" ;; esac } @@ -164,6 +167,7 @@ cd_install_packages_tools () { cd_step "Install packages tools" case "${CD_OS_NAME}" in "debian") cd_install_package "apt-utils" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_install_packages_tools" ;; esac } @@ -172,6 +176,7 @@ cd_install_ca () { cd_step "Install CA" case "${CD_OS_NAME}" in "debian") cd_install_package "ca-certificates" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_install_ca" ;; esac } @@ -181,6 +186,7 @@ local target cd_step "Copy CA" case "${CD_OS_NAME}" in "debian") target="/usr/local/share/ca-certificates" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_copy_ca" ;; esac # TODO copy @@ -190,6 +196,7 @@ cd_update_ca () { cd_step "Update CA" case "${CD_OS_NAME}" in "debian") update-ca-certificates || exit ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_update_ca" ;; esac } @@ -198,6 +205,7 @@ cd_set_https_verification_on () { cd_step "Set HTTPS verification on" case "${CD_OS_NAME}" in "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_set_https_verification_on" ;; esac } @@ -206,6 +214,7 @@ cd_upgrade_packages () { cd_step "Upgrade packages" case "${CD_OS_NAME}" in "debian") apt-get upgrade --yes || exit ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_upgrade_packages" ;; esac } @@ -214,6 +223,7 @@ cd_install_git () { cd_step "Install Git" case "${CD_OS_NAME}" in "debian") cd_install_package "git" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_install_git" ;; esac } @@ -222,6 +232,7 @@ cd_install_python () { cd_step "Install Python" case "${CD_OS_NAME}" in "debian") cd_install_package "python3" ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_install_python" ;; esac } @@ -230,6 +241,7 @@ cd_clean_packages_cache () { cd_step "Clean packages cache" case "${CD_OS_NAME}" in "debian") apt-get clean || exit ;; + "alma") echo "TODO" ;; *) cd_error_os "cd_clean_packages_cache" ;; esac } From 4d9a7671f93f952602aca9615098fdadcf39e841 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 16:41:12 +0200 Subject: [PATCH 036/392] upgrade --- cd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 3846d43..9b78b05 100644 --- a/cd.sh +++ b/cd.sh @@ -213,8 +213,8 @@ cd_set_https_verification_on () { cd_upgrade_packages () { cd_step "Upgrade packages" case "${CD_OS_NAME}" in - "debian") apt-get upgrade --yes || exit ;; - "alma") echo "TODO" ;; + "debian") apt-get upgrade --assume-yes || exit ;; + "alma") dnf upgrade --assumeyes || exit ;; *) cd_error_os "cd_upgrade_packages" ;; esac } @@ -309,7 +309,7 @@ cd_error_os () { cd_install_package () { if [ "${1}" ] ; then case "${CD_OS_NAME}" in - "debian") apt-get install --yes "${1}" || exit ;; + "debian") apt-get install --assume-yes "${1}" || exit ;; *) exit 1 ;; esac fi From ca19c5dc1bc4965507977b549036bc3fd3d80f0c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:23:10 +0200 Subject: [PATCH 037/392] install,python --- cd.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/cd.sh b/cd.sh index 9b78b05..4488d70 100644 --- a/cd.sh +++ b/cd.sh @@ -39,13 +39,19 @@ cd_set_environment () { case "${CD_OS_NAME}" in "debian") CD_PYTHON_COMMAND="python3" + CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" case "${CD_OS_VERSION}" in "bookworm") echo "TODO" ;; *) cd_error_os "CD_OS_VERSION=" ;; esac ;; - "alma") echo "TODO" ;; + "alma") + case "${CD_OS_VERSION}" in + "8") CD_PYTHON_PACKAGE="python3.11" ;; + *) cd_error_os "CD_OS_VERSION=" ;; + esac + ;; *) cd_error_os "CD_OS_NAME=" ;; esac # ci / github @@ -221,27 +227,19 @@ cd_upgrade_packages () { cd_install_git () { cd_step "Install Git" - case "${CD_OS_NAME}" in - "debian") cd_install_package "git" ;; - "alma") echo "TODO" ;; - *) cd_error_os "cd_install_git" ;; - esac + cd_install_package "git" } cd_install_python () { cd_step "Install Python" - case "${CD_OS_NAME}" in - "debian") cd_install_package "python3" ;; - "alma") echo "TODO" ;; - *) cd_error_os "cd_install_python" ;; - esac + cd_install_package "${CD_PYTHON_PACKAGE}" ;; } cd_clean_packages_cache () { cd_step "Clean packages cache" case "${CD_OS_NAME}" in "debian") apt-get clean || exit ;; - "alma") echo "TODO" ;; + "alma") dnf clean all || exit ;; *) cd_error_os "cd_clean_packages_cache" ;; esac } @@ -310,6 +308,7 @@ cd_install_package () { if [ "${1}" ] ; then case "${CD_OS_NAME}" in "debian") apt-get install --assume-yes "${1}" || exit ;; + "alma") dnf install --assumeyes "${1}" || exit ;; *) exit 1 ;; esac fi From 17ce94a63fb4d000f3e127dbd3d47ccb25c8fa1b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:25:30 +0200 Subject: [PATCH 038/392] git --- cd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 4488d70..262dbe9 100644 --- a/cd.sh +++ b/cd.sh @@ -35,6 +35,7 @@ cd_main () { cd_set_environment () { cd_step "Set environment" CD_DNS_FILE="/etc/resolv.conf" + CD_GIT_PACKAGE="git" # case "${CD_OS_NAME}" in "debian") @@ -227,7 +228,7 @@ cd_upgrade_packages () { cd_install_git () { cd_step "Install Git" - cd_install_package "git" + cd_install_package "${CD_GIT_PACKAGE}" } cd_install_python () { From 461230fe16fa76dbfba62fb17e453021e5710a23 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:37:15 +0200 Subject: [PATCH 039/392] python/command,packages --- cd.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index 262dbe9..48d8b37 100644 --- a/cd.sh +++ b/cd.sh @@ -34,26 +34,30 @@ cd_main () { cd_set_environment () { cd_step "Set environment" + # CD_DNS_FILE="/etc/resolv.conf" CD_GIT_PACKAGE="git" + CD_PYTHON_COMMAND="python3" # case "${CD_OS_NAME}" in "debian") - CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" case "${CD_OS_VERSION}" in "bookworm") echo "TODO" ;; - *) cd_error_os "CD_OS_VERSION=" ;; + *) cd_error_os "CD_OS_VERSION" ;; esac ;; "alma") case "${CD_OS_VERSION}" in - "8") CD_PYTHON_PACKAGE="python3.11" ;; - *) cd_error_os "CD_OS_VERSION=" ;; + "8") + CD_PYTHON_PACKAGE="python3.11" + CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" + ;; + *) cd_error_os "CD_OS_VERSION" ;; esac ;; - *) cd_error_os "CD_OS_NAME=" ;; + *) cd_error_os "CD_OS_NAME" ;; esac # ci / github if [ "${GITHUB_ACTIONS}" ] ; then From 2de5d957473d8e71b76ee49f6e7387737419d7a8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:44:57 +0200 Subject: [PATCH 040/392] update-ca-trust --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 48d8b37..d1ac177 100644 --- a/cd.sh +++ b/cd.sh @@ -207,7 +207,7 @@ cd_update_ca () { cd_step "Update CA" case "${CD_OS_NAME}" in "debian") update-ca-certificates || exit ;; - "alma") echo "TODO" ;; + "alma") update-ca-trust || exit ;; *) cd_error_os "cd_update_ca" ;; esac } From 4bff4f687c3430379ee7af6fa16dbea18e391316 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:47:34 +0200 Subject: [PATCH 041/392] ca/anchors --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index d1ac177..9039eb9 100644 --- a/cd.sh +++ b/cd.sh @@ -197,7 +197,7 @@ local target cd_step "Copy CA" case "${CD_OS_NAME}" in "debian") target="/usr/local/share/ca-certificates" ;; - "alma") echo "TODO" ;; + "alma") target="/etc/pki/ca-trust/source/anchors" ;; *) cd_error_os "cd_copy_ca" ;; esac # TODO copy From 571c4369616d28e6fae8260821e9d32cccecc28d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:53:51 +0200 Subject: [PATCH 042/392] ca_package --- cd.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index 9039eb9..b84ae39 100644 --- a/cd.sh +++ b/cd.sh @@ -35,6 +35,7 @@ cd_main () { cd_set_environment () { cd_step "Set environment" # + CD_CA_PACKAGE="ca-certificates" CD_DNS_FILE="/etc/resolv.conf" CD_GIT_PACKAGE="git" CD_PYTHON_COMMAND="python3" @@ -185,11 +186,7 @@ cd_install_packages_tools () { cd_install_ca () { cd_step "Install CA" - case "${CD_OS_NAME}" in - "debian") cd_install_package "ca-certificates" ;; - "alma") echo "TODO" ;; - *) cd_error_os "cd_install_ca" ;; - esac + cd_install_package "${CD_CA_PACKAGE}" } cd_copy_ca () { From e4cd7b186f75ce52d68135d37225b781ff960013 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:57:06 +0200 Subject: [PATCH 043/392] =?UTF-8?q?=E2=88=92bookworm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cd.sh b/cd.sh index b84ae39..a6696b6 100644 --- a/cd.sh +++ b/cd.sh @@ -44,10 +44,6 @@ cd_set_environment () { "debian") CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" - case "${CD_OS_VERSION}" in - "bookworm") echo "TODO" ;; - *) cd_error_os "CD_OS_VERSION" ;; - esac ;; "alma") case "${CD_OS_VERSION}" in From a4be78f3ef719b8150da9666e930eaea6833c92a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 17:58:57 +0200 Subject: [PATCH 044/392] fix --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index a6696b6..97ae1a8 100644 --- a/cd.sh +++ b/cd.sh @@ -230,7 +230,7 @@ cd_install_git () { cd_install_python () { cd_step "Install Python" - cd_install_package "${CD_PYTHON_PACKAGE}" ;; + cd_install_package "${CD_PYTHON_PACKAGE}" } cd_clean_packages_cache () { From 8e0c8a88eb4a32d41bb5449f54d91eaf38fd8e06 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 19:57:18 +0200 Subject: [PATCH 045/392] dnf/https --- cd.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 97ae1a8..d4d7f2f 100644 --- a/cd.sh +++ b/cd.sh @@ -143,7 +143,7 @@ Dir::Etc::SourceParts \"\"; " cd_cat "/etc/apt/apt.conf.d/apt.conf" ;; - "alma") echo "TODO" ;; + "alma") mkdir "/etc/dnf/dnf.conf.d" || exit ;; *) cd_error_os "cd_set_packages_configuration" ;; esac } @@ -157,7 +157,12 @@ Acquire::https::Verify-Peer False; " cd_cat "/etc/apt/apt.conf.d/https" ;; - "alma") echo "TODO" ;; + "alma") + cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ +sslverify=False +" + cd_cat "/etc/dnf/dnf.conf.d/https.conf" + ;; *) cd_error_os "cd_set_https_verification_off" ;; esac } @@ -209,7 +214,7 @@ cd_set_https_verification_on () { cd_step "Set HTTPS verification on" case "${CD_OS_NAME}" in "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; - "alma") echo "TODO" ;; + "alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; *) cd_error_os "cd_set_https_verification_on" ;; esac } From 903e203857caf9ab2842db440b969684aa35c048 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 20:07:17 +0200 Subject: [PATCH 046/392] cd_cat --- cd.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index d4d7f2f..d7d9fd1 100644 --- a/cd.sh +++ b/cd.sh @@ -109,7 +109,6 @@ local text="" " done cd_write "${CD_DNS_FILE}" "${text}" - cd_cat "${CD_DNS_FILE}" } cd_set_packages_repositories () { @@ -122,7 +121,6 @@ deb https://deb.debian.org/debian bookworm-backports main deb https://deb.debian.org/debian bookworm-updates main deb https://deb.debian.org/debian-security bookworm-security main " - cd_cat "/etc/apt/sources.list" ;; "alma") echo "TODO" ;; *) cd_error_os "cd_set_packages_repositories" ;; @@ -141,7 +139,6 @@ APT::Install-Recommends False; APT::Install-Suggests False; Dir::Etc::SourceParts \"\"; " - cd_cat "/etc/apt/apt.conf.d/apt.conf" ;; "alma") mkdir "/etc/dnf/dnf.conf.d" || exit ;; *) cd_error_os "cd_set_packages_configuration" ;; @@ -155,13 +152,11 @@ cd_set_https_verification_off () { cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; " - cd_cat "/etc/apt/apt.conf.d/https" ;; "alma") cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ sslverify=False " - cd_cat "/etc/dnf/dnf.conf.d/https.conf" ;; *) cd_error_os "cd_set_https_verification_off" ;; esac @@ -293,7 +288,7 @@ ${1} cd_cat () { if [ -f "${1}" ] ; then - echo "╭$(realpath "${1}")" + echo "╭ $(realpath "${1}")" cat "${1}" || exit fi } @@ -342,6 +337,7 @@ local text="${2}" echo -n "${text}" \ > "${file}" \ || exit + cd_cat "${file}" fi } From 58c689a05979722b563e004cfa696434d6f7fae1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 20:16:14 +0200 Subject: [PATCH 047/392] cd_mkdir --- cd.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index d7d9fd1..bf7248a 100644 --- a/cd.sh +++ b/cd.sh @@ -140,7 +140,7 @@ APT::Install-Suggests False; Dir::Etc::SourceParts \"\"; " ;; - "alma") mkdir "/etc/dnf/dnf.conf.d" || exit ;; + "alma") cd_mkdir "/etc/dnf/dnf.conf.d" ;; *) cd_error_os "cd_set_packages_configuration" ;; esac } @@ -288,7 +288,7 @@ ${1} cd_cat () { if [ -f "${1}" ] ; then - echo "╭ $(realpath "${1}")" + echo " ↙ /etc╭ $(realpath "${1}")" cat "${1}" || exit fi } @@ -312,9 +312,16 @@ cd_install_package () { fi } +cd_mkdir () { + if [ "${1}" ] ; then + echo "→ ${1}" + mkdir --parents "${1}" || exit + fi +} + cd_rm () { if [ -e "${1}" ] ; then - echo "× $(realpath "${1}")" + echo "← $(realpath "${1}")" rm --recursive "${1}" || exit fi } From 44b4b5b3572d32410d8bd4c8b88c8ee70a562b65 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 20:46:08 +0200 Subject: [PATCH 048/392] fixes --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index bf7248a..4717b24 100644 --- a/cd.sh +++ b/cd.sh @@ -193,7 +193,7 @@ local target "alma") target="/etc/pki/ca-trust/source/anchors" ;; *) cd_error_os "cd_copy_ca" ;; esac - # TODO copy + echo "TODO" } cd_update_ca () { @@ -288,7 +288,7 @@ ${1} cd_cat () { if [ -f "${1}" ] ; then - echo " ↙ /etc╭ $(realpath "${1}")" + echo " ↙ $(realpath "${1}")" cat "${1}" || exit fi } From f27e5adbd38d6498e39d2f234882d7188459fb84 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 22:41:28 +0200 Subject: [PATCH 049/392] repos --- cd.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 4717b24..7777146 100644 --- a/cd.sh +++ b/cd.sh @@ -112,6 +112,8 @@ local text="" } cd_set_packages_repositories () { +local expression +local file cd_step "Set packages repositories" case "${CD_OS_NAME}" in "debian") @@ -122,7 +124,15 @@ deb https://deb.debian.org/debian bookworm-updates main deb https://deb.debian.org/debian-security bookworm-security main " ;; - "alma") echo "TODO" ;; + "alma") + file="/etc/yum.repos.d/almalinux.repo" + for expression in \ + "|^m|# m|" \ + "|^# b|b|" \ + ; do + sed --in-place "s${expression}g" "${file}" || exit + done + ;; *) cd_error_os "cd_set_packages_repositories" ;; esac } From dac01bb13b3fc30ffc58184135c6f56baf953f4b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 22:43:51 +0200 Subject: [PATCH 050/392] cd_cat --- cd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cd.sh b/cd.sh index 7777146..9af56b4 100644 --- a/cd.sh +++ b/cd.sh @@ -132,6 +132,7 @@ deb https://deb.debian.org/debian-security bookworm-security main ; do sed --in-place "s${expression}g" "${file}" || exit done + cd_cat "${file}" ;; *) cd_error_os "cd_set_packages_repositories" ;; esac From 3de8ea1b230987c3125df5d8d181e295d5d1947f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 29 Apr 2024 23:07:52 +0200 Subject: [PATCH 051/392] cd_sed --- cd.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 9af56b4..60e36e1 100644 --- a/cd.sh +++ b/cd.sh @@ -126,12 +126,7 @@ deb https://deb.debian.org/debian-security bookworm-security main ;; "alma") file="/etc/yum.repos.d/almalinux.repo" - for expression in \ - "|^m|# m|" \ - "|^# b|b|" \ - ; do - sed --in-place "s${expression}g" "${file}" || exit - done + cd_sed "${file}" "|^m|# m|" "|^# b|b|" cd_cat "${file}" ;; *) cd_error_os "cd_set_packages_repositories" ;; @@ -337,6 +332,18 @@ cd_rm () { fi } +cd_sed () { +local expression +local file + if [ -f "${1}" ] ; then + file="${1}" + shift + for expression in "${@}" ; do + sed --in-place "s${expression}g" "${file}" || exit + done + fi +} + cd_step () { if [ "${1}" ] ; then CD_STEP=$((CD_STEP+1)) From 292d5e0c9e616ce3f61594004d8a075a1c2d6057 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 12:30:08 +0200 Subject: [PATCH 052/392] cd_write_ca --- cd.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 60e36e1..7ea99ee 100644 --- a/cd.sh +++ b/cd.sh @@ -18,7 +18,7 @@ cd_main () { cd_update_packages_catalog cd_install_packages_tools cd_install_ca - cd_copy_ca + cd_write_ca cd_update_ca cd_set_https_verification_on cd_update_packages_catalog @@ -191,15 +191,23 @@ cd_install_ca () { cd_install_package "${CD_CA_PACKAGE}" } -cd_copy_ca () { +cd_write_ca () { +local index local target +local text cd_step "Copy CA" case "${CD_OS_NAME}" in "debian") target="/usr/local/share/ca-certificates" ;; "alma") target="/etc/pki/ca-trust/source/anchors" ;; *) cd_error_os "cd_copy_ca" ;; esac - echo "TODO" + index=1 + eval "text=\${CD_CA_${index}}" + while [ "${text}" ] ; do + cd_write "${target}/${index}.crt" "${text}" + index=$((index+1)) + eval "text=\${CD_CA_${index}}" + done } cd_update_ca () { From 1998b57e899a18e86dce5cc1826f9098d823cddb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 12:31:56 +0200 Subject: [PATCH 053/392] _certificates --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 7ea99ee..99764141 100644 --- a/cd.sh +++ b/cd.sh @@ -17,9 +17,9 @@ cd_main () { cd_set_https_verification_off cd_update_packages_catalog cd_install_packages_tools - cd_install_ca - cd_write_ca - cd_update_ca + cd_install_ca_certificates + cd_write_ca_certificates + cd_update_ca_certificates cd_set_https_verification_on cd_update_packages_catalog cd_upgrade_packages @@ -186,12 +186,12 @@ cd_install_packages_tools () { esac } -cd_install_ca () { +cd_install_ca_certificates () { cd_step "Install CA" cd_install_package "${CD_CA_PACKAGE}" } -cd_write_ca () { +cd_write_ca_certificates () { local index local target local text @@ -210,7 +210,7 @@ local text done } -cd_update_ca () { +cd_update_ca_certificates () { cd_step "Update CA" case "${CD_OS_NAME}" in "debian") update-ca-certificates || exit ;; From 54dd37f1c32aae7da4fdc3b3e03b1bfbc7fa9f70 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 12:36:33 +0200 Subject: [PATCH 054/392] split,step --- cd.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 99764141..0fa61f8 100644 --- a/cd.sh +++ b/cd.sh @@ -352,13 +352,19 @@ local file fi } +cd_split () { + echo -n "\ +╶─╌╌┄┄┈┈ +" +} + cd_step () { if [ "${1}" ] ; then CD_STEP=$((CD_STEP+1)) echo -n "\ -╭─╌┄┈ +╭─╌╌┄┄┈┈ │ ${CD_STEP} ${1} -╰─╌┄┈ +╰─╌╌┄┄┈┈ " fi } From 8739a7be34a4a741087bcf495edb9c53cbf76f62 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 13:15:13 +0200 Subject: [PATCH 055/392] alma/9 --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 0fa61f8..eb54620 100644 --- a/cd.sh +++ b/cd.sh @@ -47,7 +47,7 @@ cd_set_environment () { ;; "alma") case "${CD_OS_VERSION}" in - "8") + "8"|"9") CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; From 3349f51a23a4be33ccad8e2131bb99dde82c6317 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 13:40:11 +0200 Subject: [PATCH 056/392] ca/deb/mkdir --- cd.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index eb54620..47a94a6 100644 --- a/cd.sh +++ b/cd.sh @@ -197,7 +197,10 @@ local target local text cd_step "Copy CA" case "${CD_OS_NAME}" in - "debian") target="/usr/local/share/ca-certificates" ;; + "debian") + target="/usr/local/share/ca-certificates" + cd_mkdir "${target}" + ;; "alma") target="/etc/pki/ca-trust/source/anchors" ;; *) cd_error_os "cd_copy_ca" ;; esac From 179f2344019b0d65527a0b2dcd45252265fe4ef5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 13:44:12 +0200 Subject: [PATCH 057/392] cat/corner --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 47a94a6..755d6bb 100644 --- a/cd.sh +++ b/cd.sh @@ -305,7 +305,7 @@ ${1} cd_cat () { if [ -f "${1}" ] ; then - echo " ↙ $(realpath "${1}")" + echo "╭╴$(realpath "${1}")" cat "${1}" || exit fi } From dc52d4f73dbdbbf5061d6f1cdfbcb4347d2867f4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 13:45:05 +0200 Subject: [PATCH 058/392] split --- cd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cd.sh b/cd.sh index 755d6bb..cc02193 100644 --- a/cd.sh +++ b/cd.sh @@ -268,6 +268,7 @@ local url root="$(mktemp --directory)" || exit echo "${root}" for repository in "${@}" ; do + cd_split url="${CD_PROJECTS_URL}/${repository}" echo -n " ${url} From 338f437861228554bc61005f83cfd1879297fb2e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 30 Apr 2024 13:46:23 +0200 Subject: [PATCH 059/392] mv --- cd.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/cd.sh b/cd.sh index cc02193..fddb122 100644 --- a/cd.sh +++ b/cd.sh @@ -14,11 +14,11 @@ cd_main () { cd_set_dns_resolving ${CD_DNS} cd_set_packages_repositories cd_set_packages_configuration + cd_write_ca_certificates cd_set_https_verification_off cd_update_packages_catalog cd_install_packages_tools cd_install_ca_certificates - cd_write_ca_certificates cd_update_ca_certificates cd_set_https_verification_on cd_update_packages_catalog @@ -151,6 +151,28 @@ Dir::Etc::SourceParts \"\"; esac } +cd_write_ca_certificates () { +local index +local target +local text + cd_step "Copy CA" + case "${CD_OS_NAME}" in + "debian") + target="/usr/local/share/ca-certificates" + cd_mkdir "${target}" + ;; + "alma") target="/etc/pki/ca-trust/source/anchors" ;; + *) cd_error_os "cd_copy_ca" ;; + esac + index=1 + eval "text=\${CD_CA_${index}}" + while [ "${text}" ] ; do + cd_write "${target}/${index}.crt" "${text}" + index=$((index+1)) + eval "text=\${CD_CA_${index}}" + done +} + cd_set_https_verification_off () { cd_step "Set HTTPS verification off" case "${CD_OS_NAME}" in @@ -191,28 +213,6 @@ cd_install_ca_certificates () { cd_install_package "${CD_CA_PACKAGE}" } -cd_write_ca_certificates () { -local index -local target -local text - cd_step "Copy CA" - case "${CD_OS_NAME}" in - "debian") - target="/usr/local/share/ca-certificates" - cd_mkdir "${target}" - ;; - "alma") target="/etc/pki/ca-trust/source/anchors" ;; - *) cd_error_os "cd_copy_ca" ;; - esac - index=1 - eval "text=\${CD_CA_${index}}" - while [ "${text}" ] ; do - cd_write "${target}/${index}.crt" "${text}" - index=$((index+1)) - eval "text=\${CD_CA_${index}}" - done -} - cd_update_ca_certificates () { cd_step "Update CA" case "${CD_OS_NAME}" in From a5177e565bbd60a85485690fe55f456735034bbb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 1 May 2024 20:23:33 +0200 Subject: [PATCH 060/392] count ca --- cd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cd.sh b/cd.sh index fddb122..707cafa 100644 --- a/cd.sh +++ b/cd.sh @@ -168,6 +168,7 @@ local text eval "text=\${CD_CA_${index}}" while [ "${text}" ] ; do cd_write "${target}/${index}.crt" "${text}" + CD_CA=$((CD_CA+1)) index=$((index+1)) eval "text=\${CD_CA_${index}}" done From f4b875930ed32fd28ce9f6160c16bbd27de88d2d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 1 May 2024 20:26:11 +0200 Subject: [PATCH 061/392] cd_ca/https --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 707cafa..2b5abdf 100644 --- a/cd.sh +++ b/cd.sh @@ -15,12 +15,12 @@ cd_main () { cd_set_packages_repositories cd_set_packages_configuration cd_write_ca_certificates - cd_set_https_verification_off + [ "${CD_CA}" ] && cd_set_https_verification_off cd_update_packages_catalog cd_install_packages_tools cd_install_ca_certificates cd_update_ca_certificates - cd_set_https_verification_on + [ "${CD_CA}" ] && cd_set_https_verification_on cd_update_packages_catalog cd_upgrade_packages cd_install_git From 1b1d94724bf65f987c6c5ec3c3a4b422b276610f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 1 May 2024 20:33:24 +0200 Subject: [PATCH 062/392] splits --- cd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 2b5abdf..6eff02a 100644 --- a/cd.sh +++ b/cd.sh @@ -271,7 +271,7 @@ local url for repository in "${@}" ; do cd_split url="${CD_PROJECTS_URL}/${repository}" - echo -n " + echo -n "\ ${url} ↓ " @@ -288,6 +288,7 @@ ${CD_PYTHON_PACKAGES} "${path}" "${CD_PYTHON_PACKAGES}" \ || exit done + cd_split cd_rm "${root}" } From 5787bf6fcafc176d2aa7292670ae142824f32ae8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 08:38:49 +0200 Subject: [PATCH 063/392] if inside https functions --- cd.sh | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/cd.sh b/cd.sh index 6eff02a..d5a54ae 100644 --- a/cd.sh +++ b/cd.sh @@ -15,12 +15,12 @@ cd_main () { cd_set_packages_repositories cd_set_packages_configuration cd_write_ca_certificates - [ "${CD_CA}" ] && cd_set_https_verification_off + cd_set_https_verification_off cd_update_packages_catalog cd_install_packages_tools cd_install_ca_certificates cd_update_ca_certificates - [ "${CD_CA}" ] && cd_set_https_verification_on + cd_set_https_verification_on cd_update_packages_catalog cd_upgrade_packages cd_install_git @@ -175,20 +175,22 @@ local text } cd_set_https_verification_off () { - cd_step "Set HTTPS verification off" - case "${CD_OS_NAME}" in - "debian") - cd_write "/etc/apt/apt.conf.d/https" "\ + if [ "${CD_CA}" ] ; then + cd_step "Set HTTPS verification off" + case "${CD_OS_NAME}" in + "debian") + cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; " - ;; - "alma") - cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ + ;; + "alma") + cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ sslverify=False " - ;; - *) cd_error_os "cd_set_https_verification_off" ;; - esac + ;; + *) cd_error_os "cd_set_https_verification_off" ;; + esac + fi } cd_update_packages_catalog () { @@ -224,12 +226,14 @@ cd_update_ca_certificates () { } cd_set_https_verification_on () { - cd_step "Set HTTPS verification on" - case "${CD_OS_NAME}" in - "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; - "alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; - *) cd_error_os "cd_set_https_verification_on" ;; - esac + if [ "${CD_CA}" ] ; then + cd_step "Set HTTPS verification on" + case "${CD_OS_NAME}" in + "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; + "alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; + *) cd_error_os "cd_set_https_verification_on" ;; + esac + fi } cd_upgrade_packages () { From 38d213895037aac4d9fb0a17aef0a2db831eb199 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 09:33:50 +0200 Subject: [PATCH 064/392] cd_ca_root --- cd.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cd.sh b/cd.sh index d5a54ae..981908d 100644 --- a/cd.sh +++ b/cd.sh @@ -42,10 +42,12 @@ cd_set_environment () { # case "${CD_OS_NAME}" in "debian") + CD_CA_ROOT="/usr/local/share/ca-certificates" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; "alma") + CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" case "${CD_OS_VERSION}" in "8"|"9") CD_PYTHON_PACKAGE="python3.11" @@ -153,21 +155,13 @@ Dir::Etc::SourceParts \"\"; cd_write_ca_certificates () { local index -local target local text cd_step "Copy CA" - case "${CD_OS_NAME}" in - "debian") - target="/usr/local/share/ca-certificates" - cd_mkdir "${target}" - ;; - "alma") target="/etc/pki/ca-trust/source/anchors" ;; - *) cd_error_os "cd_copy_ca" ;; - esac + cd_mkdir "${CD_CA_ROOT}" index=1 eval "text=\${CD_CA_${index}}" while [ "${text}" ] ; do - cd_write "${target}/${index}.crt" "${text}" + cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" CD_CA=$((CD_CA+1)) index=$((index+1)) eval "text=\${CD_CA_${index}}" From e745890b3305127b3be539b4aafdf3db8bd2b533 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 09:39:17 +0200 Subject: [PATCH 065/392] shrink --- cd.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/cd.sh b/cd.sh index 981908d..8aa2714 100644 --- a/cd.sh +++ b/cd.sh @@ -53,10 +53,10 @@ cd_set_environment () { CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; - *) cd_error_os "CD_OS_VERSION" ;; + *) cd_error_os "CD_OS_VERSION=${CD_OS_VERSION}" ;; esac ;; - *) cd_error_os "CD_OS_NAME" ;; + *) cd_error_os "CD_OS_NAME=${CD_OS_NAME}" ;; esac # ci / github if [ "${GITHUB_ACTIONS}" ] ; then @@ -131,7 +131,6 @@ deb https://deb.debian.org/debian-security bookworm-security main cd_sed "${file}" "|^m|# m|" "|^# b|b|" cd_cat "${file}" ;; - *) cd_error_os "cd_set_packages_repositories" ;; esac } @@ -149,7 +148,6 @@ Dir::Etc::SourceParts \"\"; " ;; "alma") cd_mkdir "/etc/dnf/dnf.conf.d" ;; - *) cd_error_os "cd_set_packages_configuration" ;; esac } @@ -182,7 +180,6 @@ Acquire::https::Verify-Peer False; sslverify=False " ;; - *) cd_error_os "cd_set_https_verification_off" ;; esac fi } @@ -192,7 +189,6 @@ cd_update_packages_catalog () { case "${CD_OS_NAME}" in "debian") apt-get update || exit ;; "alma") dnf makecache || exit ;; - *) cd_error_os "cd_update_packages_catalog" ;; esac } @@ -201,7 +197,6 @@ cd_install_packages_tools () { case "${CD_OS_NAME}" in "debian") cd_install_package "apt-utils" ;; "alma") echo "TODO" ;; - *) cd_error_os "cd_install_packages_tools" ;; esac } @@ -215,7 +210,6 @@ cd_update_ca_certificates () { case "${CD_OS_NAME}" in "debian") update-ca-certificates || exit ;; "alma") update-ca-trust || exit ;; - *) cd_error_os "cd_update_ca" ;; esac } @@ -225,7 +219,6 @@ cd_set_https_verification_on () { case "${CD_OS_NAME}" in "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; "alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; - *) cd_error_os "cd_set_https_verification_on" ;; esac fi } @@ -235,7 +228,6 @@ cd_upgrade_packages () { case "${CD_OS_NAME}" in "debian") apt-get upgrade --assume-yes || exit ;; "alma") dnf upgrade --assumeyes || exit ;; - *) cd_error_os "cd_upgrade_packages" ;; esac } @@ -254,7 +246,6 @@ cd_clean_packages_cache () { case "${CD_OS_NAME}" in "debian") apt-get clean || exit ;; "alma") dnf clean all || exit ;; - *) cd_error_os "cd_clean_packages_cache" ;; esac } @@ -325,7 +316,6 @@ cd_install_package () { case "${CD_OS_NAME}" in "debian") apt-get install --assume-yes "${1}" || exit ;; "alma") dnf install --assumeyes "${1}" || exit ;; - *) exit 1 ;; esac fi } From b3adfe318253ee9f02eeaa0b6d013cc254df0cba Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 09:59:17 +0200 Subject: [PATCH 066/392] cd_echo --- cd.sh | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/cd.sh b/cd.sh index 8aa2714..fdddc65 100644 --- a/cd.sh +++ b/cd.sh @@ -33,6 +33,7 @@ cd_main () { # functions cd_set_environment () { +local variable cd_step "Set environment" # CD_CA_PACKAGE="ca-certificates" @@ -42,12 +43,11 @@ cd_set_environment () { # case "${CD_OS_NAME}" in "debian") - CD_CA_ROOT="/usr/local/share/ca-certificates" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" + CD_CA_ROOT="/usr/local/share/ca-certificates" ;; "alma") - CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" case "${CD_OS_VERSION}" in "8"|"9") CD_PYTHON_PACKAGE="python3.11" @@ -55,6 +55,7 @@ cd_set_environment () { ;; *) cd_error_os "CD_OS_VERSION=${CD_OS_VERSION}" ;; esac + CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" ;; *) cd_error_os "CD_OS_NAME=${CD_OS_NAME}" ;; esac @@ -83,23 +84,16 @@ cd_set_environment () { CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # - echo -n "\ -CD_OS_NAME=${CD_OS_NAME} -CD_OS_VERSION=${CD_OS_VERSION} -# -CD_DNS_FILE=${CD_DNS_FILE} -# -CD_PYTHON_COMMAND=${CD_PYTHON_COMMAND} -CD_PYTHON_PACKAGES=${CD_PYTHON_PACKAGES} -# -CD_SERVER_URL=${CD_SERVER_URL} -CD_PROJECTS_GROUP=${CD_PROJECTS_GROUP} -CD_PROJECT_NAME=${CD_PROJECT_NAME} -CD_PROJECT_BRANCH=${CD_PROJECT_BRANCH} -# -CD_PROJECTS_URL=${CD_PROJECTS_URL} -CD_PROJECT_URL=${CD_PROJECT_URL} -" + cd_echo "CD_OS_NAME" "CD_OS_VERSION" + cd_split + cd_echo "CD_DNS_FILE" + cd_split + cd_echo "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" "CD_CA_ROOT" + cd_split + cd_echo "CD_SERVER_URL" \ + "CD_PROJECTS_GROUP" "CD_PROJECT_NAME" "CD_PROJECT_BRANCH" + cd_split + cd_echo "CD_PROJECTS_URL" "CD_PROJECT_URL" } cd_set_dns_resolving () { @@ -302,6 +296,15 @@ cd_cat () { fi } +cd_echo () { +local name + if [ "${1}" ] ; then + for name in "${@}" ; do + eval "echo ${name}=\${${name}}" + done + fi +} + cd_error_ci () { echo "× CI: ${1}" exit 1 From 0cb9952b32689ed525b24e2ba816f1f824b000e4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:19:18 +0200 Subject: [PATCH 067/392] cd_nop --- cd.sh | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index fdddc65..a0f90ba 100644 --- a/cd.sh +++ b/cd.sh @@ -8,7 +8,7 @@ cd \ rwx \ " -# steps +# main cd_main () { cd_set_environment cd_set_dns_resolving ${CD_DNS} @@ -30,7 +30,7 @@ cd_main () { cd_execute_python_module ${CD_PYTHON_MODULES} } -# functions +# steps cd_set_environment () { local variable @@ -43,6 +43,10 @@ local variable # case "${CD_OS_NAME}" in "debian") + case "${CD_OS_VERSION}" in + "bookworm"|"bullseye") cd_nop ;; + *) cd_error_os "CD_OS_VERSION=${CD_OS_VERSION}" ;; + esac CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" CD_CA_ROOT="/usr/local/share/ca-certificates" @@ -114,10 +118,10 @@ local file case "${CD_OS_NAME}" in "debian") cd_write "/etc/apt/sources.list" "\ -deb https://deb.debian.org/debian bookworm main -deb https://deb.debian.org/debian bookworm-backports main -deb https://deb.debian.org/debian bookworm-updates main -deb https://deb.debian.org/debian-security bookworm-security main +deb https://deb.debian.org/debian ${CD_OS_VERSION} main +deb https://deb.debian.org/debian ${CD_OS_VERSION}-backports main +deb https://deb.debian.org/debian ${CD_OS_VERSION}-updates main +deb https://deb.debian.org/debian-security ${CD_OS_VERSION}-security main " ;; "alma") @@ -287,7 +291,7 @@ ${1} "${CD_PYTHON_COMMAND}" -m "${1}" "${CD_STEP}" "${self}" } -# tools +# functions cd_cat () { if [ -f "${1}" ] ; then @@ -330,6 +334,10 @@ cd_mkdir () { fi } +cd_nop () { + true +} + cd_rm () { if [ -e "${1}" ] ; then echo "← $(realpath "${1}")" @@ -377,5 +385,5 @@ local text="${2}" fi } -# main +# run cd_main From c356baee6de36204ef1ef753917dd61ab504becb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:27:18 +0200 Subject: [PATCH 068/392] dns --- cd.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index a0f90ba..930e37e 100644 --- a/cd.sh +++ b/cd.sh @@ -1,8 +1,10 @@ #! /usr/bin/env sh -[ "${CD_DNS}" ] || CD_DNS="\ +# defaults +CD_DEFAULT_DNS="\ 9.9.9.9 \ " + CD_PYTHON_MODULES="\ cd \ rwx \ @@ -11,7 +13,7 @@ rwx \ # main cd_main () { cd_set_environment - cd_set_dns_resolving ${CD_DNS} + cd_set_dns_resolving cd_set_packages_repositories cd_set_packages_configuration cd_write_ca_certificates @@ -102,9 +104,11 @@ local variable cd_set_dns_resolving () { local server +local servers local text="" cd_step "Set DNS resolving" - for server in "${@}" ; do + "${CD_DNS}" && servers="${CD_DNS}" || servers="${CD_DEFAULT_DNS}" + for server in ${servers} ; do text="${text}nameserver ${server} " done From e891d90b4360902a102c7805f149fc53e1ee5ddf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:28:34 +0200 Subject: [PATCH 069/392] nop --- cd.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 930e37e..ccc0d49 100644 --- a/cd.sh +++ b/cd.sh @@ -338,9 +338,7 @@ cd_mkdir () { fi } -cd_nop () { - true -} +cd_nop () { true ; } cd_rm () { if [ -e "${1}" ] ; then From efac9b8463b7454b812b79e17683ac6805629be7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:29:43 +0200 Subject: [PATCH 070/392] cd_write --- cd.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index ccc0d49..ca22d36 100644 --- a/cd.sh +++ b/cd.sh @@ -380,9 +380,7 @@ cd_write () { local file="${1}" local text="${2}" if [ "${file}" ] ; then - echo -n "${text}" \ - > "${file}" \ - || exit + echo -n "${text}" > "${file}" || exit cd_cat "${file}" fi } From 82e2249bbfc6c072cca870729342d732f8e010c0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:33:34 +0200 Subject: [PATCH 071/392] cd_error_os --- cd.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index ca22d36..4ef96ea 100644 --- a/cd.sh +++ b/cd.sh @@ -47,7 +47,7 @@ local variable "debian") case "${CD_OS_VERSION}" in "bookworm"|"bullseye") cd_nop ;; - *) cd_error_os "CD_OS_VERSION=${CD_OS_VERSION}" ;; + *) cd_error_os "CD_OS_VERSION" ;; esac CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -59,11 +59,11 @@ local variable CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; - *) cd_error_os "CD_OS_VERSION=${CD_OS_VERSION}" ;; + *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" ;; - *) cd_error_os "CD_OS_NAME=${CD_OS_NAME}" ;; + *) cd_error_os "CD_OS_NAME" ;; esac # ci / github if [ "${GITHUB_ACTIONS}" ] ; then @@ -317,8 +317,11 @@ cd_error_ci () { echo "× CI: ${1}" exit 1 } + cd_error_os () { - echo "× OS: ${1}" +local variable="${1}" + echo -n "× OS: " + cd_echo "${variable}" exit 2 } From 082f231b60477f8e9a2139bd150f57fb359954f4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:57:24 +0200 Subject: [PATCH 072/392] fix --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 4ef96ea..8d3a52c 100644 --- a/cd.sh +++ b/cd.sh @@ -107,7 +107,7 @@ local server local servers local text="" cd_step "Set DNS resolving" - "${CD_DNS}" && servers="${CD_DNS}" || servers="${CD_DEFAULT_DNS}" + [ "${CD_DNS}" ] && servers="${CD_DNS}" || servers="${CD_DEFAULT_DNS}" for server in ${servers} ; do text="${text}nameserver ${server} " From 15bd46e9aad2db8cd9a63d6210a0ab4973be4dc9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 10:58:02 +0200 Subject: [PATCH 073/392] variables --- readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/readme.md b/readme.md index 95f9c4b..f2dcd3e 100644 --- a/readme.md +++ b/readme.md @@ -9,6 +9,12 @@ * [X] ForgeJo / Gitea / GitHub * [X] GitLab +## How + +### Variables + +| CD_DNS | Space separated servers | + ## Tasks * use constants for OS names From d5c258be4714f2cb429e0ceec1b87b24a078c98d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 11:03:10 +0200 Subject: [PATCH 074/392] hr --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index f2dcd3e..b91715b 100644 --- a/readme.md +++ b/readme.md @@ -13,6 +13,7 @@ ### Variables +|--------|-------------------------| | CD_DNS | Space separated servers | ## Tasks From 6932ec8f0ac2c54304221c8c187de34c741a18bf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 11:04:12 +0200 Subject: [PATCH 075/392] th --- readme.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index b91715b..e7751bd 100644 --- a/readme.md +++ b/readme.md @@ -11,10 +11,9 @@ ## How -### Variables - -|--------|-------------------------| -| CD_DNS | Space separated servers | +| Variable | Description | +|----------|-------------------------| +| CD_DNS | Space separated servers | ## Tasks From 092d84c433a744135dd9d9ce02380f51f25aaea2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 11:10:54 +0200 Subject: [PATCH 076/392] constants/alma,debian --- cd.sh | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/cd.sh b/cd.sh index 8d3a52c..f049f04 100644 --- a/cd.sh +++ b/cd.sh @@ -44,7 +44,7 @@ local variable CD_PYTHON_COMMAND="python3" # case "${CD_OS_NAME}" in - "debian") + "${CD_OS_DEBIAN}") case "${CD_OS_VERSION}" in "bookworm"|"bullseye") cd_nop ;; *) cd_error_os "CD_OS_VERSION" ;; @@ -53,7 +53,7 @@ local variable CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" CD_CA_ROOT="/usr/local/share/ca-certificates" ;; - "alma") + "${CD_OS_ALMA}") case "${CD_OS_VERSION}" in "8"|"9") CD_PYTHON_PACKAGE="python3.11" @@ -120,7 +120,7 @@ local expression local file cd_step "Set packages repositories" case "${CD_OS_NAME}" in - "debian") + "${CD_OS_DEBIAN}") cd_write "/etc/apt/sources.list" "\ deb https://deb.debian.org/debian ${CD_OS_VERSION} main deb https://deb.debian.org/debian ${CD_OS_VERSION}-backports main @@ -128,7 +128,7 @@ deb https://deb.debian.org/debian ${CD_OS_VERSION}-updates main deb https://deb.debian.org/debian-security ${CD_OS_VERSION}-security main " ;; - "alma") + "${CD_OS_ALMA}") file="/etc/yum.repos.d/almalinux.repo" cd_sed "${file}" "|^m|# m|" "|^# b|b|" cd_cat "${file}" @@ -139,7 +139,7 @@ deb https://deb.debian.org/debian-security ${CD_OS_VERSION}-security main cd_set_packages_configuration () { cd_step "Set packages configuration" case "${CD_OS_NAME}" in - "debian") + "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" cd_write "/etc/apt/apt.conf.d/apt.conf" "\ Acquire::Check-Valid-Until True; @@ -149,7 +149,7 @@ APT::Install-Suggests False; Dir::Etc::SourceParts \"\"; " ;; - "alma") cd_mkdir "/etc/dnf/dnf.conf.d" ;; + "${CD_OS_ALMA}") cd_mkdir "/etc/dnf/dnf.conf.d" ;; esac } @@ -172,12 +172,12 @@ cd_set_https_verification_off () { if [ "${CD_CA}" ] ; then cd_step "Set HTTPS verification off" case "${CD_OS_NAME}" in - "debian") + "${CD_OS_DEBIAN}") cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; " ;; - "alma") + "${CD_OS_ALMA}") cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ sslverify=False " @@ -189,16 +189,16 @@ sslverify=False cd_update_packages_catalog () { cd_step "Update packages catalog" case "${CD_OS_NAME}" in - "debian") apt-get update || exit ;; - "alma") dnf makecache || exit ;; + "${CD_OS_DEBIAN}") apt-get update || exit ;; + "${CD_OS_ALMA}") dnf makecache || exit ;; esac } cd_install_packages_tools () { cd_step "Install packages tools" case "${CD_OS_NAME}" in - "debian") cd_install_package "apt-utils" ;; - "alma") echo "TODO" ;; + "${CD_OS_DEBIAN}") cd_install_package "apt-utils" ;; + "${CD_OS_ALMA}") echo "TODO" ;; esac } @@ -210,8 +210,8 @@ cd_install_ca_certificates () { cd_update_ca_certificates () { cd_step "Update CA" case "${CD_OS_NAME}" in - "debian") update-ca-certificates || exit ;; - "alma") update-ca-trust || exit ;; + "${CD_OS_DEBIAN}") update-ca-certificates || exit ;; + "${CD_OS_ALMA}") update-ca-trust || exit ;; esac } @@ -219,8 +219,8 @@ cd_set_https_verification_on () { if [ "${CD_CA}" ] ; then cd_step "Set HTTPS verification on" case "${CD_OS_NAME}" in - "debian") cd_rm "/etc/apt/apt.conf.d/https" ;; - "alma") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; + "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; + "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; esac fi } @@ -228,8 +228,8 @@ cd_set_https_verification_on () { cd_upgrade_packages () { cd_step "Upgrade packages" case "${CD_OS_NAME}" in - "debian") apt-get upgrade --assume-yes || exit ;; - "alma") dnf upgrade --assumeyes || exit ;; + "${CD_OS_DEBIAN}") apt-get upgrade --assume-yes || exit ;; + "${CD_OS_ALMA}") dnf upgrade --assumeyes || exit ;; esac } @@ -246,8 +246,8 @@ cd_install_python () { cd_clean_packages_cache () { cd_step "Clean packages cache" case "${CD_OS_NAME}" in - "debian") apt-get clean || exit ;; - "alma") dnf clean all || exit ;; + "${CD_OS_DEBIAN}") apt-get clean || exit ;; + "${CD_OS_ALMA}") dnf clean all || exit ;; esac } @@ -328,8 +328,8 @@ local variable="${1}" cd_install_package () { if [ "${1}" ] ; then case "${CD_OS_NAME}" in - "debian") apt-get install --assume-yes "${1}" || exit ;; - "alma") dnf install --assumeyes "${1}" || exit ;; + "${CD_OS_DEBIAN}") apt-get install --assume-yes "${1}" || exit ;; + "${CD_OS_ALMA}") dnf install --assumeyes "${1}" || exit ;; esac fi } @@ -388,5 +388,10 @@ local text="${2}" fi } +# constants + +CD_OS_ALMA="alma" +CD_OS_DEBIAN="debian" + # run cd_main From f808f4bfe7ff213d913f99e75bffd0e2156bc4db Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 11:12:09 +0200 Subject: [PATCH 077/392] alma/nop --- cd.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index f049f04..79ebce9 100644 --- a/cd.sh +++ b/cd.sh @@ -49,19 +49,18 @@ local variable "bookworm"|"bullseye") cd_nop ;; *) cd_error_os "CD_OS_VERSION" ;; esac + CD_CA_ROOT="/usr/local/share/ca-certificates" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" - CD_CA_ROOT="/usr/local/share/ca-certificates" ;; "${CD_OS_ALMA}") case "${CD_OS_VERSION}" in - "8"|"9") - CD_PYTHON_PACKAGE="python3.11" - CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" - ;; + "8"|"9") cd_nop ;; *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_PYTHON_PACKAGE="python3.11" + CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; *) cd_error_os "CD_OS_NAME" ;; esac From add6886d09b42bb1236d8afd629465d191221e80 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 2 May 2024 16:46:08 +0200 Subject: [PATCH 078/392] cd_get_string --- cd.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cd.sh b/cd.sh index 79ebce9..3161651 100644 --- a/cd.sh +++ b/cd.sh @@ -324,6 +324,10 @@ local variable="${1}" exit 2 } +cd_get_string () { + [ "${1}" ] && echo "${1}" | cut -d "=" -f 2 | cut -d "\"" -f 2 +} + cd_install_package () { if [ "${1}" ] ; then case "${CD_OS_NAME}" in From 3abf55f7217cbbfcae549d5ab7603c72de90a4a6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 12:42:35 +0200 Subject: [PATCH 079/392] cd_grep_os --- cd.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 3161651..29060d7 100644 --- a/cd.sh +++ b/cd.sh @@ -324,8 +324,13 @@ local variable="${1}" exit 2 } -cd_get_string () { - [ "${1}" ] && echo "${1}" | cut -d "=" -f 2 | cut -d "\"" -f 2 +cd_grep_os () { +local variable="${1}" + if [ "${variable}" ] ; then + grep "^${variable}=" "/etc/os-release" \ + | sed "s|^${variable}||" \ + | sed "s|^\"\(.*\)\"$|\1|" + fi } cd_install_package () { From 231c8411055e55786e3ec0f15464559a4da201c4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 12:45:25 +0200 Subject: [PATCH 080/392] cd_os_id --- cd.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cd.sh b/cd.sh index 29060d7..57ddc83 100644 --- a/cd.sh +++ b/cd.sh @@ -43,7 +43,7 @@ local variable CD_GIT_PACKAGE="git" CD_PYTHON_COMMAND="python3" # - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") case "${CD_OS_VERSION}" in "bookworm"|"bullseye") cd_nop ;; @@ -62,7 +62,7 @@ local variable CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; - *) cd_error_os "CD_OS_NAME" ;; + *) cd_error_os "CD_OS_ID" ;; esac # ci / github if [ "${GITHUB_ACTIONS}" ] ; then @@ -89,7 +89,7 @@ local variable CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # - cd_echo "CD_OS_NAME" "CD_OS_VERSION" + cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_split cd_echo "CD_DNS_FILE" cd_split @@ -118,7 +118,7 @@ cd_set_packages_repositories () { local expression local file cd_step "Set packages repositories" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") cd_write "/etc/apt/sources.list" "\ deb https://deb.debian.org/debian ${CD_OS_VERSION} main @@ -137,7 +137,7 @@ deb https://deb.debian.org/debian-security ${CD_OS_VERSION}-security main cd_set_packages_configuration () { cd_step "Set packages configuration" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" cd_write "/etc/apt/apt.conf.d/apt.conf" "\ @@ -170,7 +170,7 @@ local text cd_set_https_verification_off () { if [ "${CD_CA}" ] ; then cd_step "Set HTTPS verification off" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; @@ -187,7 +187,7 @@ sslverify=False cd_update_packages_catalog () { cd_step "Update packages catalog" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") apt-get update || exit ;; "${CD_OS_ALMA}") dnf makecache || exit ;; esac @@ -195,7 +195,7 @@ cd_update_packages_catalog () { cd_install_packages_tools () { cd_step "Install packages tools" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") cd_install_package "apt-utils" ;; "${CD_OS_ALMA}") echo "TODO" ;; esac @@ -208,7 +208,7 @@ cd_install_ca_certificates () { cd_update_ca_certificates () { cd_step "Update CA" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") update-ca-certificates || exit ;; "${CD_OS_ALMA}") update-ca-trust || exit ;; esac @@ -217,7 +217,7 @@ cd_update_ca_certificates () { cd_set_https_verification_on () { if [ "${CD_CA}" ] ; then cd_step "Set HTTPS verification on" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; esac @@ -226,7 +226,7 @@ cd_set_https_verification_on () { cd_upgrade_packages () { cd_step "Upgrade packages" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") apt-get upgrade --assume-yes || exit ;; "${CD_OS_ALMA}") dnf upgrade --assumeyes || exit ;; esac @@ -244,7 +244,7 @@ cd_install_python () { cd_clean_packages_cache () { cd_step "Clean packages cache" - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") apt-get clean || exit ;; "${CD_OS_ALMA}") dnf clean all || exit ;; esac @@ -335,7 +335,7 @@ local variable="${1}" cd_install_package () { if [ "${1}" ] ; then - case "${CD_OS_NAME}" in + case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") apt-get install --assume-yes "${1}" || exit ;; "${CD_OS_ALMA}") dnf install --assumeyes "${1}" || exit ;; esac From c6846165aa303b3306110b95945721084ac00056 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 12:55:28 +0200 Subject: [PATCH 081/392] detect cd_os_id --- cd.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 57ddc83..0e50c6a 100644 --- a/cd.sh +++ b/cd.sh @@ -12,7 +12,7 @@ rwx \ # main cd_main () { - cd_set_environment + cd_set_environment_variables cd_set_dns_resolving cd_set_packages_repositories cd_set_packages_configuration @@ -34,9 +34,14 @@ cd_main () { # steps -cd_set_environment () { +cd_set_environment_variables () { local variable - cd_step "Set environment" + cd_step "Set environment variables" + # + case "$(cd_grep_os ID)" in + "debian") CD_OS_ID="${CD_OS_DEBIAN}" ;; + "almalinux") CD_OS_ID="${CD_OS_ALMA}" ;; + esac # CD_CA_PACKAGE="ca-certificates" CD_DNS_FILE="/etc/resolv.conf" From 62690422f5f7b4fae9ab048da124c25a2b569400 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 13:03:47 +0200 Subject: [PATCH 082/392] detect cd_os_version --- cd.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 0e50c6a..01a8ca8 100644 --- a/cd.sh +++ b/cd.sh @@ -39,8 +39,14 @@ local variable cd_step "Set environment variables" # case "$(cd_grep_os ID)" in - "debian") CD_OS_ID="${CD_OS_DEBIAN}" ;; - "almalinux") CD_OS_ID="${CD_OS_ALMA}" ;; + "debian") + CD_OS_ID="${CD_OS_DEBIAN}" + CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" + ;; + "almalinux") + CD_OS_ID="${CD_OS_ALMA}" + CD_OS_VERSION="$(cd_grep_os VERSION_ID)" + ;; esac # CD_CA_PACKAGE="ca-certificates" @@ -60,7 +66,7 @@ local variable ;; "${CD_OS_ALMA}") case "${CD_OS_VERSION}" in - "8"|"9") cd_nop ;; + "8."*|"9."*) cd_nop ;; *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" From a102db152b634eb3e483c2a724422ab8bbeb9468 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 13:06:52 +0200 Subject: [PATCH 083/392] ci --- cd.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 01a8ca8..f255508 100644 --- a/cd.sh +++ b/cd.sh @@ -75,20 +75,21 @@ local variable ;; *) cd_error_os "CD_OS_ID" ;; esac - # ci / github + # continuous integration platform if [ "${GITHUB_ACTIONS}" ] ; then + # forgejo / gitea / github CD_SERVER_URL="${GITHUB_SERVER_URL}" CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" - # ci / gitlab elif [ "${GITLAB_CI}" ] ; then + # gitlab CD_SERVER_URL="${CI_SERVER_URL}" CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" - # ci / none else + # unsupported cd_error_ci "ø" fi # From 210768479c75d112519e5932aef578711a13f257 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 13:14:52 +0200 Subject: [PATCH 084/392] = --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index f255508..5f31937 100644 --- a/cd.sh +++ b/cd.sh @@ -340,7 +340,7 @@ cd_grep_os () { local variable="${1}" if [ "${variable}" ] ; then grep "^${variable}=" "/etc/os-release" \ - | sed "s|^${variable}||" \ + | sed "s|^${variable}=||" \ | sed "s|^\"\(.*\)\"$|\1|" fi } From 103b8f86e8ff999a1bfcedfe3643ccc400c8221c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 14:11:52 +0200 Subject: [PATCH 085/392] errors --- cd.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 5f31937..620e659 100644 --- a/cd.sh +++ b/cd.sh @@ -326,14 +326,14 @@ local name cd_error_ci () { echo "× CI: ${1}" - exit 1 + exit ${CD_ERROR_CI} } cd_error_os () { local variable="${1}" echo -n "× OS: " cd_echo "${variable}" - exit 2 + exit ${CD_ERROR_OS} } cd_grep_os () { @@ -410,6 +410,9 @@ local text="${2}" # constants +CD_ERROR_CI=2 +CD_ERROR_OS=1 + CD_OS_ALMA="alma" CD_OS_DEBIAN="debian" From 2759ffc0df237ccc75e672f7e8dea4ff57426af0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 15:11:58 +0200 Subject: [PATCH 086/392] readme --- readme.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index e7751bd..937d295 100644 --- a/readme.md +++ b/readme.md @@ -1,20 +1,29 @@ # Continuous Deployment +Get build-time Python commands \ +from various CA, CI, OCI / OS. + ## Features -* [ ] detect - * [ ] OS name - * [ ] OS version -* [X] handle CI platforms - * [X] ForgeJo / Gitea / GitHub - * [X] GitLab +* [ ] support + * [ ] package repositories mirror + * [ ] custom CA certificates + * [X] known CA certificates + * [X] Operating Systems + * [X] Debian + * [X] Alma + * [X] Continuous Integration platforms + * [X] ForgeJo / Gitea / GitHub + * [X] GitLab ## How | Variable | Description | |----------|-------------------------| +| CD_CA_n | Numbered CA certificate | | CD_DNS | Space separated servers | ## Tasks -* use constants for OS names +* split count & write for CA certificates +* define package repositories mirror locations From f1f4b974fe1672e4560f02ca8e666ce226ad42de Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 15:50:32 +0200 Subject: [PATCH 087/392] tasks --- readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 937d295..77e470c 100644 --- a/readme.md +++ b/readme.md @@ -25,5 +25,7 @@ from various CA, CI, OCI / OS. ## Tasks +* integrate project repository cloning +* override repository and framework locations +* redefine package repositories mirror locations * split count & write for CA certificates -* define package repositories mirror locations From a23f212c8c3c4b48d11417584f026100fa64564a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:12:59 +0200 Subject: [PATCH 088/392] forks --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 77e470c..3db75ee 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,7 @@ from various CA, CI, OCI / OS. * [X] Debian * [X] Alma * [X] Continuous Integration platforms - * [X] ForgeJo / Gitea / GitHub + * [X] GitHub → Gitea → ForgeJo * [X] GitLab ## How From 0d0de7e3a67d8395a1ebac4efd252bdf6255a8a0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:17:20 +0200 Subject: [PATCH 089/392] gitea --- .gitea | 1 + 1 file changed, 1 insertion(+) create mode 120000 .gitea diff --git a/.gitea b/.gitea new file mode 120000 index 0000000..d9a4b42 --- /dev/null +++ b/.gitea @@ -0,0 +1 @@ +.forgejo \ No newline at end of file From 46dea2addeabb0f00b1197c6d7afb4ef9efcec38 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:28:50 +0200 Subject: [PATCH 090/392] github --- .github | 1 + 1 file changed, 1 insertion(+) create mode 120000 .github diff --git a/.github b/.github new file mode 120000 index 0000000..d9a4b42 --- /dev/null +++ b/.github @@ -0,0 +1 @@ +.forgejo \ No newline at end of file From 8b9db953796f9815b9fd9bfafcc96d68399fedf6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:30:35 +0200 Subject: [PATCH 091/392] =?UTF-8?q?=E2=88=92gitlab/vars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fe266b8..ba792b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,5 @@ image: debian:bookworm - job: - variables: - CD_OS_NAME: debian - CD_OS_VERSION: bookworm script: - pwd && ls -a -l - source ${CD} From 9bc4cdb6472e431ab67357e833441f698ee76011 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:31:39 +0200 Subject: [PATCH 092/392] =?UTF-8?q?=E2=88=92forgejo/vars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/main.yaml | 2 -- .gitlab-ci.yml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index aa1629a..7ac4390 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -8,8 +8,6 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - CD_OS_NAME: debian - CD_OS_VERSION: bookworm run: eval ${{vars.cd}} - run: cd-list-environment diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba792b0..3de640e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ job: script: - pwd && ls -a -l - source ${CD} + - cd-list-environment - cd-clone-branch - cd-browse-workspace From 4c28c76e8babb1f0de355647b6cfa35e87a4729f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:33:15 +0200 Subject: [PATCH 093/392] license --- license.md | 660 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 660 insertions(+) create mode 100644 license.md diff --git a/license.md b/license.md new file mode 100644 index 0000000..c6f01c6 --- /dev/null +++ b/license.md @@ -0,0 +1,660 @@ +# GNU AFFERO GENERAL PUBLIC LICENSE + +Version 3, 19 November 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +## Preamble + +The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains +free software for all its users. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + +A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + +The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + +An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing +under this license. + +The precise terms and conditions for copying, distribution and +modification follow. + +## TERMS AND CONDITIONS + +### 0. Definitions. + +"This License" refers to version 3 of the GNU Affero General Public +License. + +"Copyright" also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a "modified version" of +the earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays "Appropriate Legal Notices" to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +### 1. Source Code. + +The "source code" for a work means the preferred form of the work for +making modifications to it. "Object code" means any non-source form of +a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +### 2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 makes +it unnecessary. + +### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +### 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +### 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +- a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. +- b) The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in section 4 + to "keep intact all notices". +- c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. +- d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +### 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +- a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. +- b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the Corresponding + Source from a network server at no charge. +- c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. +- d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. +- e) Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the general + public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +"normally used" refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +### 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +- a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or +- b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or +- c) Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or +- d) Limiting the use for publicity purposes of names of licensors + or authors of the material; or +- e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or +- f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions + of it) with contractual assumptions of liability to the recipient, + for any liability that these contractual assumptions directly + impose on those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +### 8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +### 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +### 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +### 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +### 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree to +terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +### 13. Remote Network Interaction; Use with the GNU General Public License. + +Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your +version supports such interaction) an opportunity to receive the +Corresponding Source of your version by providing access to the +Corresponding Source from a network server at no charge, through some +standard or customary means of facilitating copying of software. This +Corresponding Source shall include the Corresponding Source for any +work covered by version 3 of the GNU General Public License that is +incorporated pursuant to the following paragraph. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + +### 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU Affero General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever +published by the Free Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +### 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +### 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +### 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +## How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively state +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper +mail. + +If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for +the specific requirements. + +You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU AGPL, see . From 30fa6d940f7fdeec4bc06607d501e8bcc32f048d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:35:32 +0200 Subject: [PATCH 094/392] tasks/bootstrap --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 3db75ee..ddef9bd 100644 --- a/readme.md +++ b/readme.md @@ -29,3 +29,4 @@ from various CA, CI, OCI / OS. * override repository and framework locations * redefine package repositories mirror locations * split count & write for CA certificates +* write Python bootstrap From b4abe18a0332c85d65a7988f45c9e75ff3981309 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 16:37:02 +0200 Subject: [PATCH 095/392] pkg/nop --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 620e659..d061dd2 100644 --- a/cd.sh +++ b/cd.sh @@ -209,7 +209,7 @@ cd_install_packages_tools () { cd_step "Install packages tools" case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") cd_install_package "apt-utils" ;; - "${CD_OS_ALMA}") echo "TODO" ;; + "${CD_OS_ALMA}") cd_nop ;; esac } From c068a571e6234c87ab042cc7a4e1bf00fd97d568 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 17:19:35 +0200 Subject: [PATCH 096/392] cd_ca --- cd.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index d061dd2..c35730d 100644 --- a/cd.sh +++ b/cd.sh @@ -35,9 +35,18 @@ cd_main () { # steps cd_set_environment_variables () { -local variable +local index +local text cd_step "Set environment variables" # + index=1 + eval "text=\"\${CD_CA_${index}}\"" + while [ "${text}" ] ; do + CD_CA=${index} + index=$((index+1)) + eval "text=\"\${CD_CA_${index}}\"" + done + # case "$(cd_grep_os ID)" in "debian") CD_OS_ID="${CD_OS_DEBIAN}" @@ -101,6 +110,8 @@ local variable CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # + cd_echo "CD_CA" + cd_split cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_split cd_echo "CD_DNS_FILE" @@ -170,12 +181,11 @@ local text cd_step "Copy CA" cd_mkdir "${CD_CA_ROOT}" index=1 - eval "text=\${CD_CA_${index}}" + eval "text=\"\${CD_CA_${index}}\"" while [ "${text}" ] ; do cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" - CD_CA=$((CD_CA+1)) index=$((index+1)) - eval "text=\${CD_CA_${index}}" + eval "text=\"\${CD_CA_${index}}\"" done } From 801d5a0dee3788d387df5524e8213f6e7971d4bf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 17:20:44 +0200 Subject: [PATCH 097/392] mv --- cd.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cd.sh b/cd.sh index c35730d..e822f55 100644 --- a/cd.sh +++ b/cd.sh @@ -16,11 +16,11 @@ cd_main () { cd_set_dns_resolving cd_set_packages_repositories cd_set_packages_configuration - cd_write_ca_certificates cd_set_https_verification_off cd_update_packages_catalog cd_install_packages_tools cd_install_ca_certificates + cd_write_ca_certificates cd_update_ca_certificates cd_set_https_verification_on cd_update_packages_catalog @@ -175,20 +175,6 @@ Dir::Etc::SourceParts \"\"; esac } -cd_write_ca_certificates () { -local index -local text - cd_step "Copy CA" - cd_mkdir "${CD_CA_ROOT}" - index=1 - eval "text=\"\${CD_CA_${index}}\"" - while [ "${text}" ] ; do - cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" - index=$((index+1)) - eval "text=\"\${CD_CA_${index}}\"" - done -} - cd_set_https_verification_off () { if [ "${CD_CA}" ] ; then cd_step "Set HTTPS verification off" @@ -228,6 +214,20 @@ cd_install_ca_certificates () { cd_install_package "${CD_CA_PACKAGE}" } +cd_write_ca_certificates () { +local index +local text + cd_step "Copy CA" + cd_mkdir "${CD_CA_ROOT}" + index=1 + eval "text=\"\${CD_CA_${index}}\"" + while [ "${text}" ] ; do + cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" + index=$((index+1)) + eval "text=\"\${CD_CA_${index}}\"" + done +} + cd_update_ca_certificates () { cd_step "Update CA" case "${CD_OS_ID}" in From 8523d1b2146292018fe6d59f9de3029bdaee4834 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 17:39:49 +0200 Subject: [PATCH 098/392] python3.11 --- cd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index e822f55..4940a32 100644 --- a/cd.sh +++ b/cd.sh @@ -61,7 +61,6 @@ local text CD_CA_PACKAGE="ca-certificates" CD_DNS_FILE="/etc/resolv.conf" CD_GIT_PACKAGE="git" - CD_PYTHON_COMMAND="python3" # case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") @@ -70,6 +69,7 @@ local text *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; @@ -79,6 +79,7 @@ local text *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; From 8e4c97738edb2e7490b7415a9f901264b0962370 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 17:42:59 +0200 Subject: [PATCH 099/392] readme/alpine --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index ddef9bd..498a424 100644 --- a/readme.md +++ b/readme.md @@ -9,8 +9,9 @@ from various CA, CI, OCI / OS. * [ ] package repositories mirror * [ ] custom CA certificates * [X] known CA certificates - * [X] Operating Systems + * [ ] Operating Systems * [X] Debian + * [ ] Alpine * [X] Alma * [X] Continuous Integration platforms * [X] GitHub → Gitea → ForgeJo From 3a199fccbdc1b17b32ac8176b49717dea2dfc3e5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 17:48:38 +0200 Subject: [PATCH 100/392] readme/rocky --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 498a424..959b897 100644 --- a/readme.md +++ b/readme.md @@ -10,9 +10,10 @@ from various CA, CI, OCI / OS. * [ ] custom CA certificates * [X] known CA certificates * [ ] Operating Systems - * [X] Debian - * [ ] Alpine * [X] Alma + * [ ] Alpine + * [X] Debian + * [ ] Rocky * [X] Continuous Integration platforms * [X] GitHub → Gitea → ForgeJo * [X] GitLab @@ -29,5 +30,4 @@ from various CA, CI, OCI / OS. * integrate project repository cloning * override repository and framework locations * redefine package repositories mirror locations -* split count & write for CA certificates * write Python bootstrap From 7c10bf634d6d67c7de3f53013de57789579e1dbf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 18:42:21 +0200 Subject: [PATCH 101/392] default/mirrors --- cd.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cd.sh b/cd.sh index 4940a32..3b24eeb 100644 --- a/cd.sh +++ b/cd.sh @@ -4,6 +4,8 @@ CD_DEFAULT_DNS="\ 9.9.9.9 \ " +CD_DEFAULT_MIRROR_ALMA="https://repo.almalinux.org/almalinux" +CD_DEFAULT_MIRROR_DEBIAN="https://deb.debian.org/debian" CD_PYTHON_MODULES="\ cd \ From 3f8fbe877f710bf56e028df4a9f3fd498a9829eb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:02:51 +0200 Subject: [PATCH 102/392] repos --- cd.sh | 21 ++++++++++++++------- readme.md | 11 ++++++----- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/cd.sh b/cd.sh index 3b24eeb..622af39 100644 --- a/cd.sh +++ b/cd.sh @@ -4,8 +4,8 @@ CD_DEFAULT_DNS="\ 9.9.9.9 \ " -CD_DEFAULT_MIRROR_ALMA="https://repo.almalinux.org/almalinux" -CD_DEFAULT_MIRROR_DEBIAN="https://deb.debian.org/debian" +CD_DEFAULT_REPO_ALMA="https://repo.almalinux.org/almalinux" +CD_DEFAULT_REPO_DEBIAN="https://deb.debian.org/debian" CD_PYTHON_MODULES="\ cd \ @@ -66,6 +66,8 @@ local text # case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") + CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" + [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" case "${CD_OS_VERSION}" in "bookworm"|"bullseye") cd_nop ;; *) cd_error_os "CD_OS_VERSION" ;; @@ -76,6 +78,8 @@ local text CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; "${CD_OS_ALMA}") + CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" + [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" case "${CD_OS_VERSION}" in "8."*|"9."*) cd_nop ;; *) cd_error_os "CD_OS_VERSION" ;; @@ -147,15 +151,18 @@ local file case "${CD_OS_ID}" in "${CD_OS_DEBIAN}") cd_write "/etc/apt/sources.list" "\ -deb https://deb.debian.org/debian ${CD_OS_VERSION} main -deb https://deb.debian.org/debian ${CD_OS_VERSION}-backports main -deb https://deb.debian.org/debian ${CD_OS_VERSION}-updates main -deb https://deb.debian.org/debian-security ${CD_OS_VERSION}-security main +deb ${CD_OS_REPO} ${CD_OS_VERSION} main +deb ${CD_OS_REPO} ${CD_OS_VERSION}-backports main +deb ${CD_OS_REPO} ${CD_OS_VERSION}-updates main +deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main " ;; "${CD_OS_ALMA}") file="/etc/yum.repos.d/almalinux.repo" - cd_sed "${file}" "|^m|# m|" "|^# b|b|" + cd_sed "${file}" \ + "|^mirrorlist|# mirrorlist|" \ + "|${CD_DEFAULT_REPO_ALMA}|${CD_OS_REPO}|" \ + "|^# baseurl|baseurl|" cd_cat "${file}" ;; esac diff --git a/readme.md b/readme.md index 959b897..6f37a17 100644 --- a/readme.md +++ b/readme.md @@ -20,14 +20,15 @@ from various CA, CI, OCI / OS. ## How -| Variable | Description | -|----------|-------------------------| -| CD_CA_n | Numbered CA certificate | -| CD_DNS | Space separated servers | +| Variable | Description | +|----------------|-------------------------| +| CD_CA_n | Numbered CA certificate | +| CD_DNS | Space separated servers | +| CD_REPO_ALMA | Alma repository URL | +| CD_REPO_DEBIAN | Debian repository URL | ## Tasks * integrate project repository cloning * override repository and framework locations -* redefine package repositories mirror locations * write Python bootstrap From 94a097b29429f2f13961b3083965d9ff3188a682 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:14:27 +0200 Subject: [PATCH 103/392] readme/credentials --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 6f37a17..9511180 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,7 @@ from various CA, CI, OCI / OS. ## Tasks +* handle cloning credentials * integrate project repository cloning * override repository and framework locations * write Python bootstrap From ee15dbdf0f2d618a558e9171515d151a674368b2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:15:03 +0200 Subject: [PATCH 104/392] bookworm --- .forgejo/workflows/{main.yaml => debian:bookworm.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .forgejo/workflows/{main.yaml => debian:bookworm.yaml} (100%) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/debian:bookworm.yaml similarity index 100% rename from .forgejo/workflows/main.yaml rename to .forgejo/workflows/debian:bookworm.yaml From 1d2ce95d8a9c47ae2b447de91ae5c9a2b965f76b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:16:51 +0200 Subject: [PATCH 105/392] readme/ls --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 9511180..5800715 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,7 @@ from various CA, CI, OCI / OS. ## Tasks +* first list working directory * handle cloning credentials * integrate project repository cloning * override repository and framework locations From 40a837ce797d5ea443bfed6895b1a556dfca5d98 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:18:26 +0200 Subject: [PATCH 106/392] alma,bullseye --- .forgejo/workflows/alma:8.yaml | 13 +++++++++++++ .forgejo/workflows/alma:9.yaml | 13 +++++++++++++ .forgejo/workflows/debian:bullseye.yaml | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .forgejo/workflows/alma:8.yaml create mode 100644 .forgejo/workflows/alma:9.yaml create mode 100644 .forgejo/workflows/debian:bullseye.yaml diff --git a/.forgejo/workflows/alma:8.yaml b/.forgejo/workflows/alma:8.yaml new file mode 100644 index 0000000..a68fe22 --- /dev/null +++ b/.forgejo/workflows/alma:8.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: alma:8 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace diff --git a/.forgejo/workflows/alma:9.yaml b/.forgejo/workflows/alma:9.yaml new file mode 100644 index 0000000..8d44e7d --- /dev/null +++ b/.forgejo/workflows/alma:9.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: alma:9 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml new file mode 100644 index 0000000..82cf822 --- /dev/null +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: debian:bullseye + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace From 709b82fd528e55a41405684036d51b69867a8bec Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:21:36 +0200 Subject: [PATCH 107/392] mv --- .forgejo/workflows/{alma:8.yaml => almalinux:8.yaml} | 0 .forgejo/workflows/{alma:9.yaml => almalinux:9.yaml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .forgejo/workflows/{alma:8.yaml => almalinux:8.yaml} (100%) rename .forgejo/workflows/{alma:9.yaml => almalinux:9.yaml} (100%) diff --git a/.forgejo/workflows/alma:8.yaml b/.forgejo/workflows/almalinux:8.yaml similarity index 100% rename from .forgejo/workflows/alma:8.yaml rename to .forgejo/workflows/almalinux:8.yaml diff --git a/.forgejo/workflows/alma:9.yaml b/.forgejo/workflows/almalinux:9.yaml similarity index 100% rename from .forgejo/workflows/alma:9.yaml rename to .forgejo/workflows/almalinux:9.yaml From 49cfdb32f877285611dcb3a91179d36a5b9541fb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:22:08 +0200 Subject: [PATCH 108/392] almalinux --- .forgejo/workflows/almalinux:8.yaml | 2 +- .forgejo/workflows/almalinux:9.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index a68fe22..34df8b8 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -2,7 +2,7 @@ on: [push] jobs: job: container: - image: alma:8 + image: almalinux:8 steps: - name: cd env: diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index 8d44e7d..d510837 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -2,7 +2,7 @@ on: [push] jobs: job: container: - image: alma:9 + image: almalinux:9 steps: - name: cd env: From 9e83c7de5f1930d8c6f8fa5848630eec398b55c0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 19:31:25 +0200 Subject: [PATCH 109/392] cd_ca --- cd.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cd.sh b/cd.sh index 622af39..0ff0821 100644 --- a/cd.sh +++ b/cd.sh @@ -37,17 +37,9 @@ cd_main () { # steps cd_set_environment_variables () { -local index -local text cd_step "Set environment variables" # - index=1 - eval "text=\"\${CD_CA_${index}}\"" - while [ "${text}" ] ; do - CD_CA=${index} - index=$((index+1)) - eval "text=\"\${CD_CA_${index}}\"" - done + [ "${CD_CA_1}" ] && CD_CA=true # case "$(cd_grep_os ID)" in "debian") From 725ad1acd166aef90bdc2588568f6e9397520425 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 20:00:28 +0200 Subject: [PATCH 110/392] https --- cd.sh | 34 ++++++++++++++++------------------ readme.md | 5 +++-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/cd.sh b/cd.sh index 0ff0821..a61e8ef 100644 --- a/cd.sh +++ b/cd.sh @@ -178,21 +178,20 @@ Dir::Etc::SourceParts \"\"; } cd_set_https_verification_off () { - if [ "${CD_CA}" ] ; then - cd_step "Set HTTPS verification off" - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") - cd_write "/etc/apt/apt.conf.d/https" "\ + [ "${CD_CA}" ] || [ "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] || exit + cd_step "Set HTTPS verification off" + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}") + cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; " - ;; - "${CD_OS_ALMA}") - cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ + ;; + "${CD_OS_ALMA}") + cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ sslverify=False " - ;; - esac - fi + ;; + esac } cd_update_packages_catalog () { @@ -239,13 +238,12 @@ cd_update_ca_certificates () { } cd_set_https_verification_on () { - if [ "${CD_CA}" ] ; then - cd_step "Set HTTPS verification on" - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; - "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; - esac - fi + [ "${CD_CA}" ] || [ "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] || exit + cd_step "Set HTTPS verification on" + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; + "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; + esac } cd_upgrade_packages () { diff --git a/readme.md b/readme.md index 5800715..4498d1f 100644 --- a/readme.md +++ b/readme.md @@ -29,8 +29,9 @@ from various CA, CI, OCI / OS. ## Tasks -* first list working directory * handle cloning credentials +* write Python bootstrap + +* first list working directory * integrate project repository cloning * override repository and framework locations -* write Python bootstrap From a99369e8ae3b799272d6f83ceb9cd6dd5b068912 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 20:20:26 +0200 Subject: [PATCH 111/392] fix --- cd.sh | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/cd.sh b/cd.sh index a61e8ef..f0bd9d2 100644 --- a/cd.sh +++ b/cd.sh @@ -178,20 +178,21 @@ Dir::Etc::SourceParts \"\"; } cd_set_https_verification_off () { - [ "${CD_CA}" ] || [ "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] || exit - cd_step "Set HTTPS verification off" - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") - cd_write "/etc/apt/apt.conf.d/https" "\ + if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then + cd_step "Set HTTPS verification off" + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}") + cd_write "/etc/apt/apt.conf.d/https" "\ Acquire::https::Verify-Peer False; " - ;; - "${CD_OS_ALMA}") - cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ + ;; + "${CD_OS_ALMA}") + cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ sslverify=False " - ;; - esac + ;; + esac + fi } cd_update_packages_catalog () { @@ -238,12 +239,13 @@ cd_update_ca_certificates () { } cd_set_https_verification_on () { - [ "${CD_CA}" ] || [ "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] || exit - cd_step "Set HTTPS verification on" - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; - "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; - esac + if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then + cd_step "Set HTTPS verification on" + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; + "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; + esac + fi } cd_upgrade_packages () { From 18e3f300d36d58f492ad8b015691076a789d7cbd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 20:57:35 +0200 Subject: [PATCH 112/392] readme/certs --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 4498d1f..ab6acea 100644 --- a/readme.md +++ b/readme.md @@ -30,6 +30,7 @@ from various CA, CI, OCI / OS. ## Tasks * handle cloning credentials +* show CA certificates as text * write Python bootstrap * first list working directory From cf99e6ff2fe75fb6b89a37a3de9bed11d55f389a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:03:07 +0200 Subject: [PATCH 113/392] =?UTF-8?q?=E2=86=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 72 +++++++++++++++++++++++++++---------------------------- readme.md | 2 ++ 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/cd.sh b/cd.sh index f0bd9d2..665f82d 100644 --- a/cd.sh +++ b/cd.sh @@ -42,14 +42,14 @@ cd_set_environment_variables () { [ "${CD_CA_1}" ] && CD_CA=true # case "$(cd_grep_os ID)" in - "debian") - CD_OS_ID="${CD_OS_DEBIAN}" - CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" - ;; "almalinux") CD_OS_ID="${CD_OS_ALMA}" CD_OS_VERSION="$(cd_grep_os VERSION_ID)" ;; + "debian") + CD_OS_ID="${CD_OS_DEBIAN}" + CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" + ;; esac # CD_CA_PACKAGE="ca-certificates" @@ -57,18 +57,6 @@ cd_set_environment_variables () { CD_GIT_PACKAGE="git" # case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") - CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" - [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" - case "${CD_OS_VERSION}" in - "bookworm"|"bullseye") cd_nop ;; - *) cd_error_os "CD_OS_VERSION" ;; - esac - CD_CA_ROOT="/usr/local/share/ca-certificates" - CD_PYTHON_COMMAND="python3" - CD_PYTHON_PACKAGE="python3" - CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" - ;; "${CD_OS_ALMA}") CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" @@ -81,6 +69,18 @@ cd_set_environment_variables () { CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; + "${CD_OS_DEBIAN}") + CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" + [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" + case "${CD_OS_VERSION}" in + "bookworm"|"bullseye") cd_nop ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_PYTHON_COMMAND="python3" + CD_PYTHON_PACKAGE="python3" + CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" + ;; *) cd_error_os "CD_OS_ID" ;; esac # continuous integration platform @@ -141,14 +141,6 @@ local expression local file cd_step "Set packages repositories" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") - cd_write "/etc/apt/sources.list" "\ -deb ${CD_OS_REPO} ${CD_OS_VERSION} main -deb ${CD_OS_REPO} ${CD_OS_VERSION}-backports main -deb ${CD_OS_REPO} ${CD_OS_VERSION}-updates main -deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main -" - ;; "${CD_OS_ALMA}") file="/etc/yum.repos.d/almalinux.repo" cd_sed "${file}" \ @@ -157,12 +149,21 @@ deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main "|^# baseurl|baseurl|" cd_cat "${file}" ;; + "${CD_OS_DEBIAN}") + cd_write "/etc/apt/sources.list" "\ +deb ${CD_OS_REPO} ${CD_OS_VERSION} main +deb ${CD_OS_REPO} ${CD_OS_VERSION}-backports main +deb ${CD_OS_REPO} ${CD_OS_VERSION}-updates main +deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main +" + ;; esac } cd_set_packages_configuration () { cd_step "Set packages configuration" case "${CD_OS_ID}" in + "${CD_OS_ALMA}") cd_mkdir "/etc/dnf/dnf.conf.d" ;; "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" cd_write "/etc/apt/apt.conf.d/apt.conf" "\ @@ -173,7 +174,6 @@ APT::Install-Suggests False; Dir::Etc::SourceParts \"\"; " ;; - "${CD_OS_ALMA}") cd_mkdir "/etc/dnf/dnf.conf.d" ;; esac } @@ -181,14 +181,14 @@ cd_set_https_verification_off () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification off" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") - cd_write "/etc/apt/apt.conf.d/https" "\ -Acquire::https::Verify-Peer False; -" - ;; "${CD_OS_ALMA}") cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ sslverify=False +" + ;; + "${CD_OS_DEBIAN}") + cd_write "/etc/apt/apt.conf.d/https" "\ +Acquire::https::Verify-Peer False; " ;; esac @@ -198,16 +198,16 @@ sslverify=False cd_update_packages_catalog () { cd_step "Update packages catalog" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") apt-get update || exit ;; "${CD_OS_ALMA}") dnf makecache || exit ;; + "${CD_OS_DEBIAN}") apt-get update || exit ;; esac } cd_install_packages_tools () { cd_step "Install packages tools" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") cd_install_package "apt-utils" ;; "${CD_OS_ALMA}") cd_nop ;; + "${CD_OS_DEBIAN}") cd_install_package "apt-utils" ;; esac } @@ -233,8 +233,8 @@ local text cd_update_ca_certificates () { cd_step "Update CA" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") update-ca-certificates || exit ;; "${CD_OS_ALMA}") update-ca-trust || exit ;; + "${CD_OS_DEBIAN}") update-ca-certificates || exit ;; esac } @@ -242,8 +242,8 @@ cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; + "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; esac fi } @@ -251,8 +251,8 @@ cd_set_https_verification_on () { cd_upgrade_packages () { cd_step "Upgrade packages" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") apt-get upgrade --assume-yes || exit ;; "${CD_OS_ALMA}") dnf upgrade --assumeyes || exit ;; + "${CD_OS_DEBIAN}") apt-get upgrade --assume-yes || exit ;; esac } @@ -269,8 +269,8 @@ cd_install_python () { cd_clean_packages_cache () { cd_step "Clean packages cache" case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") apt-get clean || exit ;; "${CD_OS_ALMA}") dnf clean all || exit ;; + "${CD_OS_DEBIAN}") apt-get clean || exit ;; esac } diff --git a/readme.md b/readme.md index ab6acea..1e6dc72 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,8 @@ from various CA, CI, OCI / OS. ## Tasks +* write bats + * handle cloning credentials * show CA certificates as text * write Python bootstrap From 657e4d28a2da841e1febcd02093cbe34e1199661 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:09:30 +0200 Subject: [PATCH 114/392] agnostic --- cd.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cd.sh b/cd.sh index 665f82d..9b71a22 100644 --- a/cd.sh +++ b/cd.sh @@ -274,6 +274,8 @@ cd_clean_packages_cache () { esac } +# agnostic steps + cd_install_python_modules () { local path local repository From 6688313b48bbac0dc40e67bd5b6751829a0f1f6a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:16:03 +0200 Subject: [PATCH 115/392] clean --- cd.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 9b71a22..60e620a 100644 --- a/cd.sh +++ b/cd.sh @@ -65,6 +65,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_CMD_CLEAN="dnf clean all" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -77,6 +78,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_CMD_CLEAN="apt-get clean" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -256,6 +258,8 @@ cd_upgrade_packages () { esac } +# agnostic steps + cd_install_git () { cd_step "Install Git" cd_install_package "${CD_GIT_PACKAGE}" @@ -268,14 +272,9 @@ cd_install_python () { cd_clean_packages_cache () { cd_step "Clean packages cache" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") dnf clean all || exit ;; - "${CD_OS_DEBIAN}") apt-get clean || exit ;; - esac + ${CD_CMD_CLEAN} || exit } -# agnostic steps - cd_install_python_modules () { local path local repository From faf17ad62f46d04223f2749dcf4dcc2a04c03911 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:18:20 +0200 Subject: [PATCH 116/392] upgrade --- cd.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 60e620a..60f3343 100644 --- a/cd.sh +++ b/cd.sh @@ -66,6 +66,7 @@ cd_set_environment_variables () { esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CLEAN="dnf clean all" + CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -79,6 +80,7 @@ cd_set_environment_variables () { esac CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CLEAN="apt-get clean" + CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -250,16 +252,13 @@ cd_set_https_verification_on () { fi } +# agnostic steps + cd_upgrade_packages () { cd_step "Upgrade packages" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") dnf upgrade --assumeyes || exit ;; - "${CD_OS_DEBIAN}") apt-get upgrade --assume-yes || exit ;; - esac + ${CD_CMD_UPGRADE} || exit } -# agnostic steps - cd_install_git () { cd_step "Install Git" cd_install_package "${CD_GIT_PACKAGE}" From 288f1a3101559f18c69bdd9944f2d07499aa78ac Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:24:41 +0200 Subject: [PATCH 117/392] https --- cd.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 60f3343..93ca732 100644 --- a/cd.sh +++ b/cd.sh @@ -67,6 +67,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CLEAN="dnf clean all" CD_CMD_UPGRADE="dnf upgrade --assumeyes" + CD_FILE_HTTPS="/etc/dnf/dnf.conf.d/https.conf" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -81,6 +82,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CLEAN="apt-get clean" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" + CD_FILE_HTTPS="/etc/apt/apt.conf.d/https" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -186,12 +188,12 @@ cd_set_https_verification_off () { cd_step "Set HTTPS verification off" case "${CD_OS_ID}" in "${CD_OS_ALMA}") - cd_write "/etc/dnf/dnf.conf.d/https.conf" "\ + cd_write "${CD_FILE_HTTPS}" "\ sslverify=False " ;; "${CD_OS_DEBIAN}") - cd_write "/etc/apt/apt.conf.d/https" "\ + cd_write "${CD_FILE_HTTPS}" "\ Acquire::https::Verify-Peer False; " ;; @@ -242,18 +244,15 @@ cd_update_ca_certificates () { esac } +# agnostic steps + cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") cd_rm "/etc/dnf/dnf.conf.d/https.conf" ;; - "${CD_OS_DEBIAN}") cd_rm "/etc/apt/apt.conf.d/https" ;; - esac + cd_rm "${CD_FILE_HTTPS}" fi } -# agnostic steps - cd_upgrade_packages () { cd_step "Upgrade packages" ${CD_CMD_UPGRADE} || exit From 84ccc6f21574cbc8216e737fd3a6166035404732 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:28:37 +0200 Subject: [PATCH 118/392] ca --- cd.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 93ca732..ec8ef3c 100644 --- a/cd.sh +++ b/cd.sh @@ -65,6 +65,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_CMD_CA="update-ca-trust" CD_CMD_CLEAN="dnf clean all" CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_FILE_HTTPS="/etc/dnf/dnf.conf.d/https.conf" @@ -80,6 +81,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apt-get clean" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_FILE_HTTPS="/etc/apt/apt.conf.d/https" @@ -217,6 +219,8 @@ cd_install_packages_tools () { esac } +# agnostic steps + cd_install_ca_certificates () { cd_step "Install CA" cd_install_package "${CD_CA_PACKAGE}" @@ -225,7 +229,7 @@ cd_install_ca_certificates () { cd_write_ca_certificates () { local index local text - cd_step "Copy CA" + cd_step "Write CA certificates" cd_mkdir "${CD_CA_ROOT}" index=1 eval "text=\"\${CD_CA_${index}}\"" @@ -237,15 +241,10 @@ local text } cd_update_ca_certificates () { - cd_step "Update CA" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") update-ca-trust || exit ;; - "${CD_OS_DEBIAN}") update-ca-certificates || exit ;; - esac + cd_step "Update CA certificates" + ${CD_CMD_CA} || exit } -# agnostic steps - cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on" From a9e885bca896e06857eb547a78678228c0b184c4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:30:28 +0200 Subject: [PATCH 119/392] update --- cd.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index ec8ef3c..a0eeae7 100644 --- a/cd.sh +++ b/cd.sh @@ -67,6 +67,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" CD_CMD_CLEAN="dnf clean all" + CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_FILE_HTTPS="/etc/dnf/dnf.conf.d/https.conf" CD_PYTHON_COMMAND="python3.11" @@ -83,6 +84,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apt-get clean" + CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_FILE_HTTPS="/etc/apt/apt.conf.d/https" CD_PYTHON_COMMAND="python3" @@ -205,10 +207,7 @@ Acquire::https::Verify-Peer False; cd_update_packages_catalog () { cd_step "Update packages catalog" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") dnf makecache || exit ;; - "${CD_OS_DEBIAN}") apt-get update || exit ;; - esac + ${CD_CMD_UPDATE} || exit } cd_install_packages_tools () { From 8b9ddbec9fd3443242ec05d151d19bc0efb4941a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:36:19 +0200 Subject: [PATCH 120/392] https --- cd.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/cd.sh b/cd.sh index a0eeae7..eb67a13 100644 --- a/cd.sh +++ b/cd.sh @@ -69,7 +69,8 @@ cd_set_environment_variables () { CD_CMD_CLEAN="dnf clean all" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" - CD_FILE_HTTPS="/etc/dnf/dnf.conf.d/https.conf" + CD_FILE_HTTPS_NAME="/etc/dnf/dnf.conf.d/https.conf" + CD_FILE_HTTPS_TEXT="sslverify=False" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -86,7 +87,8 @@ cd_set_environment_variables () { CD_CMD_CLEAN="apt-get clean" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" - CD_FILE_HTTPS="/etc/apt/apt.conf.d/https" + CD_FILE_HTTPS_NAME="/etc/apt/apt.conf.d/https" + CD_FILE_HTTPS_TEXT="Acquire::https::Verify-Peer False;" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -190,18 +192,7 @@ Dir::Etc::SourceParts \"\"; cd_set_https_verification_off () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification off" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") - cd_write "${CD_FILE_HTTPS}" "\ -sslverify=False -" - ;; - "${CD_OS_DEBIAN}") - cd_write "${CD_FILE_HTTPS}" "\ -Acquire::https::Verify-Peer False; -" - ;; - esac + cd_write "${CD_FILE_HTTPS_NAME}" "${CD_FILE_HTTPS_TEXT}" fi } @@ -247,7 +238,7 @@ cd_update_ca_certificates () { cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on" - cd_rm "${CD_FILE_HTTPS}" + cd_rm "${CD_FILE_HTTPS_NAME}" fi } From 585e1d58e2184ea3abce1e3e20ab9ffa73c4ca91 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:43:25 +0200 Subject: [PATCH 121/392] pkg --- cd.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index eb67a13..1e17327 100644 --- a/cd.sh +++ b/cd.sh @@ -71,6 +71,7 @@ cd_set_environment_variables () { CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_FILE_HTTPS_NAME="/etc/dnf/dnf.conf.d/https.conf" CD_FILE_HTTPS_TEXT="sslverify=False" + CD_PKG_PKG="" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -89,6 +90,7 @@ cd_set_environment_variables () { CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_FILE_HTTPS_NAME="/etc/apt/apt.conf.d/https" CD_FILE_HTTPS_TEXT="Acquire::https::Verify-Peer False;" + CD_PKG_PKG="apt-utils" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -189,6 +191,8 @@ Dir::Etc::SourceParts \"\"; esac } +# agnostic steps + cd_set_https_verification_off () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification off" @@ -203,14 +207,9 @@ cd_update_packages_catalog () { cd_install_packages_tools () { cd_step "Install packages tools" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") cd_nop ;; - "${CD_OS_DEBIAN}") cd_install_package "apt-utils" ;; - esac + cd_install_package "${CD_PKG_PKG}" } -# agnostic steps - cd_install_ca_certificates () { cd_step "Install CA" cd_install_package "${CD_CA_PACKAGE}" From a73bdd235f0555fd6fb4e10be906e6b6b98b11f4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:52:08 +0200 Subject: [PATCH 122/392] mkdir,path --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 1e17327..0852a55 100644 --- a/cd.sh +++ b/cd.sh @@ -69,7 +69,7 @@ cd_set_environment_variables () { CD_CMD_CLEAN="dnf clean all" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" - CD_FILE_HTTPS_NAME="/etc/dnf/dnf.conf.d/https.conf" + CD_FILE_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_FILE_HTTPS_TEXT="sslverify=False" CD_PKG_PKG="" CD_PYTHON_COMMAND="python3.11" @@ -88,7 +88,7 @@ cd_set_environment_variables () { CD_CMD_CLEAN="apt-get clean" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" - CD_FILE_HTTPS_NAME="/etc/apt/apt.conf.d/https" + CD_FILE_HTTPS_PATH="/etc/apt/apt.conf.d/https" CD_FILE_HTTPS_TEXT="Acquire::https::Verify-Peer False;" CD_PKG_PKG="apt-utils" CD_PYTHON_COMMAND="python3" @@ -196,7 +196,8 @@ Dir::Etc::SourceParts \"\"; cd_set_https_verification_off () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification off" - cd_write "${CD_FILE_HTTPS_NAME}" "${CD_FILE_HTTPS_TEXT}" + cd_mkdir "$(dirname "${CD_FILE_HTTPS_PATH}")" + cd_write "${CD_FILE_HTTPS_PATH}" "${CD_FILE_HTTPS_TEXT}" fi } @@ -237,7 +238,7 @@ cd_update_ca_certificates () { cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on" - cd_rm "${CD_FILE_HTTPS_NAME}" + cd_rm "${CD_FILE_HTTPS_PATH}" fi } From 98ecacd8c8a66e267177b26009cdc81f4a090c3d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:53:25 +0200 Subject: [PATCH 123/392] readme --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 1e6dc72..51e54e5 100644 --- a/readme.md +++ b/readme.md @@ -32,9 +32,11 @@ from various CA, CI, OCI / OS. * write bats * handle cloning credentials +* make steps more agnostic * show CA certificates as text * write Python bootstrap * first list working directory * integrate project repository cloning * override repository and framework locations +* reduce operating system version to major From 7d6f23efe9e564212168dddf5743e64f314c780a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 21:56:30 +0200 Subject: [PATCH 124/392] debian/frontend --- cd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 0852a55..17cf7ba 100644 --- a/cd.sh +++ b/cd.sh @@ -77,6 +77,8 @@ cd_set_environment_variables () { CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; "${CD_OS_DEBIAN}") + export DEBIAN_FRONTEND="noninteractive" + # CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" case "${CD_OS_VERSION}" in @@ -179,7 +181,6 @@ cd_set_packages_configuration () { case "${CD_OS_ID}" in "${CD_OS_ALMA}") cd_mkdir "/etc/dnf/dnf.conf.d" ;; "${CD_OS_DEBIAN}") - export DEBIAN_FRONTEND="noninteractive" cd_write "/etc/apt/apt.conf.d/apt.conf" "\ Acquire::Check-Valid-Until True; APT::Get::Show-Versions True; From e2bc6311af26b54a61fc8d4c788d97abeff515f1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 22:01:01 +0200 Subject: [PATCH 125/392] dnf --- cd.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 17cf7ba..c6c9e61 100644 --- a/cd.sh +++ b/cd.sh @@ -179,7 +179,16 @@ deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main cd_set_packages_configuration () { cd_step "Set packages configuration" case "${CD_OS_ID}" in - "${CD_OS_ALMA}") cd_mkdir "/etc/dnf/dnf.conf.d" ;; + "${CD_OS_ALMA}") + cd_write "/etc/dnf/dnf.conf" "\ +[main] +best=True +clean_requirements_on_remove=True +gpgcheck=1 +installonly_limit=3 +skip_if_unavailable=False +" + ;; "${CD_OS_DEBIAN}") cd_write "/etc/apt/apt.conf.d/apt.conf" "\ Acquire::Check-Valid-Until True; From 2e5e92e1285424016139b4f476ee3a894209cdae Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 22:04:05 +0200 Subject: [PATCH 126/392] pm --- cd.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index c6c9e61..7fe0fd1 100644 --- a/cd.sh +++ b/cd.sh @@ -69,9 +69,9 @@ cd_set_environment_variables () { CD_CMD_CLEAN="dnf clean all" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" - CD_FILE_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" - CD_FILE_HTTPS_TEXT="sslverify=False" CD_PKG_PKG="" + CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" + CD_PM_HTTPS_TEXT="sslverify=False" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -90,9 +90,9 @@ cd_set_environment_variables () { CD_CMD_CLEAN="apt-get clean" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" - CD_FILE_HTTPS_PATH="/etc/apt/apt.conf.d/https" - CD_FILE_HTTPS_TEXT="Acquire::https::Verify-Peer False;" CD_PKG_PKG="apt-utils" + CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" + CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;" CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" @@ -206,8 +206,8 @@ Dir::Etc::SourceParts \"\"; cd_set_https_verification_off () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification off" - cd_mkdir "$(dirname "${CD_FILE_HTTPS_PATH}")" - cd_write "${CD_FILE_HTTPS_PATH}" "${CD_FILE_HTTPS_TEXT}" + cd_mkdir "$(dirname "${CD_PM_HTTPS_PATH}")" + cd_write "${CD_PM_HTTPS_PATH}" "${CD_PM_HTTPS_TEXT}" fi } @@ -248,7 +248,7 @@ cd_update_ca_certificates () { cd_set_https_verification_on () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification on" - cd_rm "${CD_FILE_HTTPS_PATH}" + cd_rm "${CD_PM_HTTPS_PATH}" fi } From 7be21f53dd36a7691da6c6bef7460007164973a4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 22:52:24 +0200 Subject: [PATCH 127/392] pm/conf --- cd.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 7fe0fd1..6d1a81f 100644 --- a/cd.sh +++ b/cd.sh @@ -70,6 +70,7 @@ cd_set_environment_variables () { CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" + CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_PM_HTTPS_TEXT="sslverify=False" CD_PYTHON_COMMAND="python3.11" @@ -91,6 +92,7 @@ cd_set_environment_variables () { CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" + CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;" CD_PYTHON_COMMAND="python3" @@ -180,7 +182,7 @@ cd_set_packages_configuration () { cd_step "Set packages configuration" case "${CD_OS_ID}" in "${CD_OS_ALMA}") - cd_write "/etc/dnf/dnf.conf" "\ + cd_write "${CD_PM_CONF_PATH}" "\ [main] best=True clean_requirements_on_remove=True @@ -190,7 +192,7 @@ skip_if_unavailable=False " ;; "${CD_OS_DEBIAN}") - cd_write "/etc/apt/apt.conf.d/apt.conf" "\ + cd_write "${CD_PM_CONF_PATH}" "\ Acquire::Check-Valid-Until True; APT::Get::Show-Versions True; APT::Install-Recommends False; From e5d17cd0f010a506b34dc2dcfbabd27336a2026a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 3 May 2024 23:19:30 +0200 Subject: [PATCH 128/392] conf/text --- cd.sh | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/cd.sh b/cd.sh index 6d1a81f..a9b5700 100644 --- a/cd.sh +++ b/cd.sh @@ -71,6 +71,14 @@ cd_set_environment_variables () { CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" + CD_PM_CONF_TEXT="\ +[main] +best=True +clean_requirements_on_remove=True +gpgcheck=1 +installonly_limit=3 +skip_if_unavailable=False +" CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_PM_HTTPS_TEXT="sslverify=False" CD_PYTHON_COMMAND="python3.11" @@ -93,6 +101,13 @@ cd_set_environment_variables () { CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" + CD_PM_CONF_TEXT="\ +Acquire::Check-Valid-Until True; +APT::Get::Show-Versions True; +APT::Install-Recommends False; +APT::Install-Suggests False; +Dir::Etc::SourceParts \"\"; +" CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;" CD_PYTHON_COMMAND="python3" @@ -178,33 +193,13 @@ deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main esac } +# agnostic steps + cd_set_packages_configuration () { cd_step "Set packages configuration" - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") - cd_write "${CD_PM_CONF_PATH}" "\ -[main] -best=True -clean_requirements_on_remove=True -gpgcheck=1 -installonly_limit=3 -skip_if_unavailable=False -" - ;; - "${CD_OS_DEBIAN}") - cd_write "${CD_PM_CONF_PATH}" "\ -Acquire::Check-Valid-Until True; -APT::Get::Show-Versions True; -APT::Install-Recommends False; -APT::Install-Suggests False; -Dir::Etc::SourceParts \"\"; -" - ;; - esac + cd_write "${CD_PM_CONF_PATH}" "${CD_PM_CONF_TEXT}" } -# agnostic steps - cd_set_https_verification_off () { if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification off" From cf446063a90f6973de7ba7ca3e23fd544cfdc3fd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 00:03:04 +0200 Subject: [PATCH 129/392] install --- cd.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index a9b5700..8424c29 100644 --- a/cd.sh +++ b/cd.sh @@ -67,6 +67,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" CD_CMD_CLEAN="dnf clean all" + CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" @@ -97,6 +98,7 @@ skip_if_unavailable=False CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apt-get clean" + CD_CMD_INSTALL="apt-get install --assume-yes" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" @@ -354,10 +356,7 @@ local variable="${1}" cd_install_package () { if [ "${1}" ] ; then - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") apt-get install --assume-yes "${1}" || exit ;; - "${CD_OS_ALMA}") dnf install --assumeyes "${1}" || exit ;; - esac + ${CD_CMD_INSTALL} "${1}" || exit fi } From 9070ae93774539fcb8cbbefcb4d91aa1fc304f61 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 00:24:14 +0200 Subject: [PATCH 130/392] cd_ln_python --- cd.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cd.sh b/cd.sh index 8424c29..c8b6d53 100644 --- a/cd.sh +++ b/cd.sh @@ -264,6 +264,8 @@ cd_install_git () { cd_install_python () { cd_step "Install Python" cd_install_package "${CD_PYTHON_PACKAGE}" + cd_split + cd_ln_python "${CD_PYTHON_COMMAND}" } cd_clean_packages_cache () { @@ -360,6 +362,13 @@ cd_install_package () { fi } +cd_ln_python () { + if [ "${1}" ] ; then + echo "python3 → ${1}" + ln --force --symbolic "${1}" "/usr/bin/python3" || exit + fi +} + cd_mkdir () { if [ "${1}" ] ; then echo "→ ${1}" From ea49325b9fb5dbba6119bf7e7c0b60fbac203682 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 00:28:49 +0200 Subject: [PATCH 131/392] deb/py --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index c8b6d53..b7c7e02 100644 --- a/cd.sh +++ b/cd.sh @@ -92,7 +92,8 @@ skip_if_unavailable=False CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" case "${CD_OS_VERSION}" in - "bookworm"|"bullseye") cd_nop ;; + "bookworm") CD_PYTHON_COMMAND="python3.11" ;; + "bullseye") CD_PYTHON_COMMAND="python3.9" ;; *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/usr/local/share/ca-certificates" @@ -112,7 +113,6 @@ Dir::Etc::SourceParts \"\"; " CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;" - CD_PYTHON_COMMAND="python3" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; From 204dfd0de6e57670623443ddcc78a136d91b5bbc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 09:26:45 +0200 Subject: [PATCH 132/392] version/major --- cd.sh | 3 ++- readme.md | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index b7c7e02..11b2f2c 100644 --- a/cd.sh +++ b/cd.sh @@ -352,7 +352,8 @@ local variable="${1}" if [ "${variable}" ] ; then grep "^${variable}=" "/etc/os-release" \ | sed "s|^${variable}=||" \ - | sed "s|^\"\(.*\)\"$|\1|" + | sed "s|^\"\(.*\)\"$|\1|" \ + | sed "s|^\([0-9]\+\)\..*|\1|" fi } diff --git a/readme.md b/readme.md index 51e54e5..a6d5328 100644 --- a/readme.md +++ b/readme.md @@ -39,4 +39,3 @@ from various CA, CI, OCI / OS. * first list working directory * integrate project repository cloning * override repository and framework locations -* reduce operating system version to major From 86dd9748b546beadb6af667a4dcd4313538126bf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 09:32:50 +0200 Subject: [PATCH 133/392] ca --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index a6d5328..bfe27bf 100644 --- a/readme.md +++ b/readme.md @@ -6,8 +6,8 @@ from various CA, CI, OCI / OS. ## Features * [ ] support - * [ ] package repositories mirror - * [ ] custom CA certificates + * [X] package repositories mirror + * [X] custom CA certificates * [X] known CA certificates * [ ] Operating Systems * [X] Alma From 30160e1544416729e54b4da715dd9a52d258fdf5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 09:50:13 +0200 Subject: [PATCH 134/392] cd_openssl --- cd.sh | 15 +++++++++++++-- readme.md | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 11b2f2c..132019a 100644 --- a/cd.sh +++ b/cd.sh @@ -227,13 +227,17 @@ cd_install_ca_certificates () { cd_write_ca_certificates () { local index +local path local text cd_step "Write CA certificates" cd_mkdir "${CD_CA_ROOT}" index=1 eval "text=\"\${CD_CA_${index}}\"" while [ "${text}" ] ; do - cd_write "${CD_CA_ROOT}/${index}.crt" "${text}" + path="${CD_CA_ROOT}/${index}.crt" + cd_split + cd_write "${path}" "${text}" + cd_openssl "${path}" index=$((index+1)) eval "text=\"\${CD_CA_${index}}\"" done @@ -320,7 +324,7 @@ ${1} # functions cd_cat () { - if [ -f "${1}" ] ; then + if [ "${1}" ] ; then echo "╭╴$(realpath "${1}")" cat "${1}" || exit fi @@ -379,6 +383,13 @@ cd_mkdir () { cd_nop () { true ; } +cd_openssl () { +local file="${1}" + if [ "${file}" ] ; then + openssl x509 -noout -text -in "${file}" || exit + fi +} + cd_rm () { if [ -e "${1}" ] ; then echo "← $(realpath "${1}")" diff --git a/readme.md b/readme.md index bfe27bf..05e6130 100644 --- a/readme.md +++ b/readme.md @@ -33,7 +33,7 @@ from various CA, CI, OCI / OS. * handle cloning credentials * make steps more agnostic -* show CA certificates as text +* reduce single conditions with && * write Python bootstrap * first list working directory From 433d917578234ac8fe5fd32e44b05caa764eb373 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 10:30:33 +0200 Subject: [PATCH 135/392] cd_ls --- cd.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cd.sh b/cd.sh index 132019a..72ea9e5 100644 --- a/cd.sh +++ b/cd.sh @@ -374,6 +374,13 @@ cd_ln_python () { fi } +cd_ls () { + if [ "${1}" ] ; then + echo "╭╴$(realpath "${1}")" + ls --all -l "${1}" || exit + fi +} + cd_mkdir () { if [ "${1}" ] ; then echo "→ ${1}" From 722c95341b67c5541236b4339c12ca5ecded3a3f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 10:32:50 +0200 Subject: [PATCH 136/392] previous --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 05e6130..783f37c 100644 --- a/readme.md +++ b/readme.md @@ -39,3 +39,4 @@ from various CA, CI, OCI / OS. * first list working directory * integrate project repository cloning * override repository and framework locations +* show previous states of directories & files From 8d91c60e2d75e60bc1ac91f774ff45b09ef0a09c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 10:39:18 +0200 Subject: [PATCH 137/392] workdir --- cd.sh | 6 ++++++ readme.md | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 72ea9e5..3c4a369 100644 --- a/cd.sh +++ b/cd.sh @@ -14,6 +14,7 @@ rwx \ # main cd_main () { + cd_list_working_directory cd_set_environment_variables cd_set_dns_resolving cd_set_packages_repositories @@ -36,6 +37,11 @@ cd_main () { # steps +cd_list_working_directory () { + cd_step "List working directory" + cd_ls "." +} + cd_set_environment_variables () { cd_step "Set environment variables" # diff --git a/readme.md b/readme.md index 783f37c..b41aa1f 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,6 @@ from various CA, CI, OCI / OS. * reduce single conditions with && * write Python bootstrap -* first list working directory * integrate project repository cloning * override repository and framework locations * show previous states of directories & files From 213e4e01f5db00fc770dcd189de34879bc78fe86 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 10:45:31 +0200 Subject: [PATCH 138/392] dns/previous --- cd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 3c4a369..7c8fb21 100644 --- a/cd.sh +++ b/cd.sh @@ -174,6 +174,7 @@ local text="" text="${text}nameserver ${server} " done + cd_cat "${CD_DNS_FILE}" cd_write "${CD_DNS_FILE}" "${text}" } @@ -405,7 +406,7 @@ local file="${1}" cd_rm () { if [ -e "${1}" ] ; then - echo "← $(realpath "${1}")" + echo "← ${1}" rm --recursive "${1}" || exit fi } @@ -443,6 +444,7 @@ cd_write () { local file="${1}" local text="${2}" if [ "${file}" ] ; then + echo "→ ${1}" echo -n "${text}" > "${file}" || exit cd_cat "${file}" fi From 4b47ea99bd4713cf5f32148f8142cbadefe53ad4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 10:50:26 +0200 Subject: [PATCH 139/392] write/previous --- cd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 7c8fb21..0869fa7 100644 --- a/cd.sh +++ b/cd.sh @@ -174,7 +174,6 @@ local text="" text="${text}nameserver ${server} " done - cd_cat "${CD_DNS_FILE}" cd_write "${CD_DNS_FILE}" "${text}" } @@ -192,7 +191,8 @@ local file cd_cat "${file}" ;; "${CD_OS_DEBIAN}") - cd_write "/etc/apt/sources.list" "\ + file="/etc/apt/sources.list" + cd_write "${file}" "\ deb ${CD_OS_REPO} ${CD_OS_VERSION} main deb ${CD_OS_REPO} ${CD_OS_VERSION}-backports main deb ${CD_OS_REPO} ${CD_OS_VERSION}-updates main @@ -444,6 +444,7 @@ cd_write () { local file="${1}" local text="${2}" if [ "${file}" ] ; then + [ -f "${file}" ] && cd_cat "${file}" echo "→ ${1}" echo -n "${text}" > "${file}" || exit cd_cat "${file}" From be42eb7d05c8d0b99cdb5e0d6dc0c75dc6f637e0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 11:03:00 +0200 Subject: [PATCH 140/392] alma/major --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 0869fa7..bbf6699 100644 --- a/cd.sh +++ b/cd.sh @@ -67,7 +67,7 @@ cd_set_environment_variables () { CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" case "${CD_OS_VERSION}" in - "8."*|"9."*) cd_nop ;; + "8"|"9") cd_nop ;; *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" From e8bdfcf982cc7efe7e47e110cef52fa22dd21b33 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 11:06:25 +0200 Subject: [PATCH 141/392] =?UTF-8?q?=E2=88=92cd=5Fnop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index bbf6699..5c6f0a2 100644 --- a/cd.sh +++ b/cd.sh @@ -67,7 +67,7 @@ cd_set_environment_variables () { CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" case "${CD_OS_VERSION}" in - "8"|"9") cd_nop ;; + "8"|"9") ;; *) cd_error_os "CD_OS_VERSION" ;; esac CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" @@ -395,8 +395,6 @@ cd_mkdir () { fi } -cd_nop () { true ; } - cd_openssl () { local file="${1}" if [ "${file}" ] ; then From 96f1d9f380159edacf3f4f229ead1d97a97084a9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:14:30 +0200 Subject: [PATCH 142/392] mv/dns --- cd.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cd.sh b/cd.sh index 5c6f0a2..ee895e4 100644 --- a/cd.sh +++ b/cd.sh @@ -16,10 +16,10 @@ rwx \ cd_main () { cd_list_working_directory cd_set_environment_variables - cd_set_dns_resolving cd_set_packages_repositories cd_set_packages_configuration cd_set_https_verification_off + cd_set_dns_resolving cd_update_packages_catalog cd_install_packages_tools cd_install_ca_certificates @@ -164,19 +164,6 @@ Dir::Etc::SourceParts \"\"; cd_echo "CD_PROJECTS_URL" "CD_PROJECT_URL" } -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 - text="${text}nameserver ${server} -" - done - cd_write "${CD_DNS_FILE}" "${text}" -} - cd_set_packages_repositories () { local expression local file @@ -217,6 +204,19 @@ cd_set_https_verification_off () { fi } +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 + text="${text}nameserver ${server} +" + done + cd_write "${CD_DNS_FILE}" "${text}" +} + cd_update_packages_catalog () { cd_step "Update packages catalog" ${CD_CMD_UPDATE} || exit From 08f20d3faf2afd0939d6e2f3aff2425ad2d3e4b0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:18:59 +0200 Subject: [PATCH 143/392] pkg/ca,git --- cd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index ee895e4..23bc6ac 100644 --- a/cd.sh +++ b/cd.sh @@ -58,9 +58,9 @@ cd_set_environment_variables () { ;; esac # - CD_CA_PACKAGE="ca-certificates" CD_DNS_FILE="/etc/resolv.conf" - CD_GIT_PACKAGE="git" + CD_PKG_CA="ca-certificates" + CD_PKG_GIT="git" # case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -229,7 +229,7 @@ cd_install_packages_tools () { cd_install_ca_certificates () { cd_step "Install CA" - cd_install_package "${CD_CA_PACKAGE}" + cd_install_package "${CD_PKG_CA}" } cd_write_ca_certificates () { @@ -269,7 +269,7 @@ cd_upgrade_packages () { cd_install_git () { cd_step "Install Git" - cd_install_package "${CD_GIT_PACKAGE}" + cd_install_package "${CD_PKG_GIT}" } cd_install_python () { From 6b4456b543061d073d0f94582d85bd112017dbba Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:32:45 +0200 Subject: [PATCH 144/392] vars --- cd.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 23bc6ac..855aafc 100644 --- a/cd.sh +++ b/cd.sh @@ -150,13 +150,20 @@ Dir::Etc::SourceParts \"\"; CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # - cd_echo "CD_CA" + cd_echo "CD_CA" "CD_CA_ROOT" cd_split cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_split + cd_echo "CD_CMD_CA" \ + "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" + cd_split cd_echo "CD_DNS_FILE" cd_split - cd_echo "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" "CD_CA_ROOT" + cd_echo "CD_PKG_CA" "CD_PKG_GIT" "CD_PKG_PKG" + cd_split + cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" + cd_split + cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" cd_split cd_echo "CD_SERVER_URL" \ "CD_PROJECTS_GROUP" "CD_PROJECT_NAME" "CD_PROJECT_BRANCH" From 2e84c6773def07e9bc9af401fa150186f03144cd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:33:56 +0200 Subject: [PATCH 145/392] sr.ht --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index b41aa1f..28c4429 100644 --- a/readme.md +++ b/readme.md @@ -14,9 +14,10 @@ from various CA, CI, OCI / OS. * [ ] Alpine * [X] Debian * [ ] Rocky - * [X] Continuous Integration platforms + * [ ] Continuous Integration platforms * [X] GitHub → Gitea → ForgeJo * [X] GitLab + * [ ] SourceHut ## How From 11eecaa08ee04296fb8893b16d3930042ad82aed Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:39:32 +0200 Subject: [PATCH 146/392] =?UTF-8?q?wip/alma=E2=86=92alpine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cd.sh b/cd.sh index 855aafc..89c8bee 100644 --- a/cd.sh +++ b/cd.sh @@ -85,6 +85,35 @@ clean_requirements_on_remove=True gpgcheck=1 installonly_limit=3 skip_if_unavailable=False +" + CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" + CD_PM_HTTPS_TEXT="sslverify=False" + CD_PYTHON_COMMAND="python3.11" + CD_PYTHON_PACKAGE="python3.11" + CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" + ;; + "${CD_OS_ALPINE}") + CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" + [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" + case "${CD_OS_VERSION}" in + "8"|"9") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_CMD_CA="update-ca-trust" + CD_CMD_CLEAN="dnf clean all" + CD_CMD_INSTALL="dnf install --assumeyes" + CD_CMD_UPDATE="dnf makecache" + CD_CMD_UPGRADE="dnf upgrade --assumeyes" + CD_PKG_PKG="" + CD_PM_CONF_PATH="/etc/dnf/dnf.conf" + CD_PM_CONF_TEXT="\ +[main] +best=True +clean_requirements_on_remove=True +gpgcheck=1 +installonly_limit=3 +skip_if_unavailable=False " CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_PM_HTTPS_TEXT="sslverify=False" @@ -462,6 +491,7 @@ CD_ERROR_CI=2 CD_ERROR_OS=1 CD_OS_ALMA="alma" +CD_OS_ALPINE="alpine" CD_OS_DEBIAN="debian" # run From e462eb2a18656d3ed0a95264f90f41b384f10eda Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:41:08 +0200 Subject: [PATCH 147/392] =?UTF-8?q?wip/alma=E2=86=92alpine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cd.sh b/cd.sh index 89c8bee..3e02202 100644 --- a/cd.sh +++ b/cd.sh @@ -213,6 +213,14 @@ local file "|^# baseurl|baseurl|" cd_cat "${file}" ;; + "${CD_OS_ALPINE}") + file="/etc/yum.repos.d/almalinux.repo" + cd_sed "${file}" \ + "|^mirrorlist|# mirrorlist|" \ + "|${CD_DEFAULT_REPO_ALMA}|${CD_OS_REPO}|" \ + "|^# baseurl|baseurl|" + cd_cat "${file}" + ;; "${CD_OS_DEBIAN}") file="/etc/apt/sources.list" cd_write "${file}" "\ From d84c18ecac88b444ca300719923db79c9d757639 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:50:20 +0200 Subject: [PATCH 148/392] wip/repos --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 3e02202..2144e6f 100644 --- a/cd.sh +++ b/cd.sh @@ -5,6 +5,7 @@ CD_DEFAULT_DNS="\ 9.9.9.9 \ " CD_DEFAULT_REPO_ALMA="https://repo.almalinux.org/almalinux" +CD_DEFAULT_REPO_ALPINE="https://dl-cdn.alpinelinux.org/alpine" CD_DEFAULT_REPO_DEBIAN="https://deb.debian.org/debian" CD_PYTHON_MODULES="\ @@ -214,12 +215,11 @@ local file cd_cat "${file}" ;; "${CD_OS_ALPINE}") - file="/etc/yum.repos.d/almalinux.repo" - cd_sed "${file}" \ - "|^mirrorlist|# mirrorlist|" \ - "|${CD_DEFAULT_REPO_ALMA}|${CD_OS_REPO}|" \ - "|^# baseurl|baseurl|" - cd_cat "${file}" + file="/etc/apk/repositories" + cd_write "${file}" "\ +${CD_OS_REPO}/v${CD_OS_VERSION}/main +${CD_OS_REPO}/v${CD_OS_VERSION}/community +" ;; "${CD_OS_DEBIAN}") file="/etc/apt/sources.list" From c6a5c94eda89e433490daba6691bd70f3dada5df Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 12:52:28 +0200 Subject: [PATCH 149/392] mv --- cd.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 2144e6f..3f3eb25 100644 --- a/cd.sh +++ b/cd.sh @@ -15,9 +15,10 @@ rwx \ # main cd_main () { - cd_list_working_directory cd_set_environment_variables cd_set_packages_repositories + # + cd_list_working_directory cd_set_packages_configuration cd_set_https_verification_off cd_set_dns_resolving @@ -38,11 +39,6 @@ cd_main () { # steps -cd_list_working_directory () { - cd_step "List working directory" - cd_ls "." -} - cd_set_environment_variables () { cd_step "Set environment variables" # @@ -235,6 +231,11 @@ deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main # agnostic steps +cd_list_working_directory () { + cd_step "List working directory" + cd_ls "." +} + cd_set_packages_configuration () { cd_step "Set packages configuration" cd_write "${CD_PM_CONF_PATH}" "${CD_PM_CONF_TEXT}" From 1e0ddbe9402aa616aaf08d5c64d5808686922d26 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 13:23:16 +0200 Subject: [PATCH 150/392] wip/pkg --- cd.sh | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/cd.sh b/cd.sh index 3f3eb25..a9abcce 100644 --- a/cd.sh +++ b/cd.sh @@ -90,33 +90,27 @@ skip_if_unavailable=False CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; "${CD_OS_ALPINE}") - CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" - [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" + CD_OS_REPO="${CD_DEFAULT_REPO_ALPINE}" + [ "${CD_REPO_ALPINE}" ] && CD_OS_REPO="${CD_REPO_ALPINE}" case "${CD_OS_VERSION}" in - "8"|"9") ;; + "3.18"|"3.19") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" - CD_CMD_CA="update-ca-trust" - CD_CMD_CLEAN="dnf clean all" - CD_CMD_INSTALL="dnf install --assumeyes" - CD_CMD_UPDATE="dnf makecache" - CD_CMD_UPGRADE="dnf upgrade --assumeyes" + CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_CMD_CA="update-ca-certificates" + CD_CMD_CLEAN="apk cache purge" + CD_CMD_INSTALL="apk add" + CD_CMD_UPDATE="apk update" + CD_CMD_UPGRADE="apk upgrade" CD_PKG_PKG="" - CD_PM_CONF_PATH="/etc/dnf/dnf.conf" - CD_PM_CONF_TEXT="\ -[main] -best=True -clean_requirements_on_remove=True -gpgcheck=1 -installonly_limit=3 -skip_if_unavailable=False -" + # TODO + CD_PM_CONF_PATH="" + CD_PM_CONF_TEXT="" CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_PM_HTTPS_TEXT="sslverify=False" CD_PYTHON_COMMAND="python3.11" - CD_PYTHON_PACKAGE="python3.11" - CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" + CD_PYTHON_PACKAGE="python3" + CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" ;; "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" From 0b9cae5ceb57c22cc3fea3abba334a2bf58c8301 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 13:35:35 +0200 Subject: [PATCH 151/392] wip/version --- cd.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index a9abcce..2235040 100644 --- a/cd.sh +++ b/cd.sh @@ -47,7 +47,13 @@ cd_set_environment_variables () { case "$(cd_grep_os ID)" in "almalinux") CD_OS_ID="${CD_OS_ALMA}" - CD_OS_VERSION="$(cd_grep_os VERSION_ID)" + CD_OS_VERSION=$(cd_grep_os VERSION_ID \ + | sed "s|^\([0-9]\+\)\..*|\1|" ) + ;; + "alpine") + CD_OS_ID="${CD_OS_ALPINE}" + CD_OS_VERSION=$(cd_grep_os VERSION_ID \ + | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|" ) ;; "debian") CD_OS_ID="${CD_OS_DEBIAN}" @@ -402,8 +408,7 @@ local variable="${1}" if [ "${variable}" ] ; then grep "^${variable}=" "/etc/os-release" \ | sed "s|^${variable}=||" \ - | sed "s|^\"\(.*\)\"$|\1|" \ - | sed "s|^\([0-9]\+\)\..*|\1|" + | sed "s|^\"\(.*\)\"$|\1|" fi } From 47e8c6ffca9767ae1950b7884e8a4da9ce1a3caf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 13:36:19 +0200 Subject: [PATCH 152/392] wip/fix --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 2235040..f78b7dd 100644 --- a/cd.sh +++ b/cd.sh @@ -48,12 +48,12 @@ cd_set_environment_variables () { "almalinux") CD_OS_ID="${CD_OS_ALMA}" CD_OS_VERSION=$(cd_grep_os VERSION_ID \ - | sed "s|^\([0-9]\+\)\..*|\1|" ) + | sed "s|^\([0-9]\+\)\..*|\1|") ;; "alpine") CD_OS_ID="${CD_OS_ALPINE}" CD_OS_VERSION=$(cd_grep_os VERSION_ID \ - | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|" ) + | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") ;; "debian") CD_OS_ID="${CD_OS_DEBIAN}" From c0369ed1019a7273d00b2234428303b1be22ffb0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 13:44:37 +0200 Subject: [PATCH 153/392] wip/https --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index f78b7dd..77f9398 100644 --- a/cd.sh +++ b/cd.sh @@ -112,8 +112,8 @@ skip_if_unavailable=False # TODO CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" - CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" - CD_PM_HTTPS_TEXT="sslverify=False" + CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" + CD_PM_HTTPS_TEXT="--no-verify" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" From c09a3c68838d53904e4b6c42c68bb80f7f6ca806 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 13:49:49 +0200 Subject: [PATCH 154/392] alpine --- .forgejo/workflows/alpine:3.18.yaml | 13 +++++++++++++ .forgejo/workflows/alpine:3.19.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .forgejo/workflows/alpine:3.18.yaml create mode 100644 .forgejo/workflows/alpine:3.19.yaml diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml new file mode 100644 index 0000000..ecf81ce --- /dev/null +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: alpine:3.18 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml new file mode 100644 index 0000000..be34e54 --- /dev/null +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: alpine:3.19 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace From 7f47ab480b8c17fa2081befd59d5acfa6c3b3fce Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 14:03:33 +0200 Subject: [PATCH 155/392] ls -a --- cd.sh | 3 +-- readme.md | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 77f9398..42e7521 100644 --- a/cd.sh +++ b/cd.sh @@ -109,7 +109,6 @@ skip_if_unavailable=False CD_CMD_UPDATE="apk update" CD_CMD_UPGRADE="apk upgrade" CD_PKG_PKG="" - # TODO CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" @@ -428,7 +427,7 @@ cd_ln_python () { cd_ls () { if [ "${1}" ] ; then echo "╭╴$(realpath "${1}")" - ls --all -l "${1}" || exit + ls -a -l "${1}" || exit fi } diff --git a/readme.md b/readme.md index 28c4429..89968dc 100644 --- a/readme.md +++ b/readme.md @@ -11,7 +11,7 @@ from various CA, CI, OCI / OS. * [X] known CA certificates * [ ] Operating Systems * [X] Alma - * [ ] Alpine + * [X] Alpine * [X] Debian * [ ] Rocky * [ ] Continuous Integration platforms @@ -22,10 +22,11 @@ from various CA, CI, OCI / OS. ## How | Variable | Description | -|----------------|-------------------------| +|:---------------|:------------------------| | CD_CA_n | Numbered CA certificate | | CD_DNS | Space separated servers | | CD_REPO_ALMA | Alma repository URL | +| CD_REPO_ALPINE | Alpine repository URL | | CD_REPO_DEBIAN | Debian repository URL | ## Tasks From a8132111032e4dd6e8612bcd1efb041f73210566 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 14:10:07 +0200 Subject: [PATCH 156/392] ln --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 42e7521..b5c45fb 100644 --- a/cd.sh +++ b/cd.sh @@ -420,7 +420,7 @@ cd_install_package () { cd_ln_python () { if [ "${1}" ] ; then echo "python3 → ${1}" - ln --force --symbolic "${1}" "/usr/bin/python3" || exit + ln -f -s "${1}" "/usr/bin/python3" || exit fi } From 92710f97d055cc40d5b8015d82970bb557a3ae28 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 14:39:33 +0200 Subject: [PATCH 157/392] rm --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index b5c45fb..bc4a618 100644 --- a/cd.sh +++ b/cd.sh @@ -448,7 +448,7 @@ local file="${1}" cd_rm () { if [ -e "${1}" ] ; then echo "← ${1}" - rm --recursive "${1}" || exit + rm -r "${1}" || exit fi } From b0e45d5ec39b4c109f128f3c88acada04b8366f3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 16:23:02 +0200 Subject: [PATCH 158/392] cd_ca --- cd.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index bc4a618..984bbe0 100644 --- a/cd.sh +++ b/cd.sh @@ -42,8 +42,6 @@ cd_main () { cd_set_environment_variables () { cd_step "Set environment variables" # - [ "${CD_CA_1}" ] && CD_CA=true - # case "$(cd_grep_os ID)" in "almalinux") CD_OS_ID="${CD_OS_ALMA}" @@ -149,6 +147,8 @@ Dir::Etc::SourceParts \"\"; ;; *) cd_error_os "CD_OS_ID" ;; esac + # variables + [ "${CD_CA_1}" ] && CD_CA=true # continuous integration platform if [ "${GITHUB_ACTIONS}" ] ; then # forgejo / gitea / github @@ -175,7 +175,7 @@ Dir::Etc::SourceParts \"\"; CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # - cd_echo "CD_CA" "CD_CA_ROOT" + cd_echo "CD_CA_ROOT" cd_split cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_split @@ -190,6 +190,8 @@ Dir::Etc::SourceParts \"\"; cd_split cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" cd_split + cd_echo "CD_CA" + cd_split cd_echo "CD_SERVER_URL" \ "CD_PROJECTS_GROUP" "CD_PROJECT_NAME" "CD_PROJECT_BRANCH" cd_split From ccd946432906b69cf8b82b8d2c8075b221a698a1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 16:30:40 +0200 Subject: [PATCH 159/392] universal --- cd.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 984bbe0..88d7d0c 100644 --- a/cd.sh +++ b/cd.sh @@ -41,7 +41,7 @@ cd_main () { cd_set_environment_variables () { cd_step "Set environment variables" - # + # operating system case "$(cd_grep_os ID)" in "almalinux") CD_OS_ID="${CD_OS_ALMA}" @@ -58,7 +58,7 @@ cd_set_environment_variables () { CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" ;; esac - # + # universal CD_DNS_FILE="/etc/resolv.conf" CD_PKG_CA="ca-certificates" CD_PKG_GIT="git" @@ -166,7 +166,6 @@ Dir::Etc::SourceParts \"\"; # unsupported cd_error_ci "ø" fi - # [ "${CD_SERVER_URL}" ] || cd_error_ci "CD_SERVER_URL" [ "${CD_PROJECTS_GROUP}" ] || cd_error_ci "CD_PROJECTS_GROUP" [ "${CD_PROJECT_NAME}" ] || cd_error_ci "CD_PROJECT_NAME" @@ -175,16 +174,16 @@ Dir::Etc::SourceParts \"\"; CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # - cd_echo "CD_CA_ROOT" - cd_split cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_split + cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" + cd_split + cd_echo "CD_CA_ROOT" + cd_split cd_echo "CD_CMD_CA" \ "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split - cd_echo "CD_DNS_FILE" - cd_split - cd_echo "CD_PKG_CA" "CD_PKG_GIT" "CD_PKG_PKG" + cd_echo "CD_PKG_PKG" cd_split cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" cd_split From 1f1cd59e1948f095e730c3b32bdc964ec0cec863 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:10:00 +0200 Subject: [PATCH 160/392] wip/common --- cd.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 88d7d0c..80e9ee7 100644 --- a/cd.sh +++ b/cd.sh @@ -42,7 +42,8 @@ cd_main () { cd_set_environment_variables () { cd_step "Set environment variables" # operating system - case "$(cd_grep_os ID)" in + CD_OS_ID="$(cd_grep_os ID)" + case "${CD_OS_ID}" in "almalinux") CD_OS_ID="${CD_OS_ALMA}" CD_OS_VERSION=$(cd_grep_os VERSION_ID \ @@ -57,11 +58,15 @@ cd_set_environment_variables () { CD_OS_ID="${CD_OS_DEBIAN}" CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" ;; + *) cd_error_os "CD_OS_ID" ;; esac # universal CD_DNS_FILE="/etc/resolv.conf" CD_PKG_CA="ca-certificates" CD_PKG_GIT="git" + # common + case "${CD_OS_ID}" in + esac # case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -145,7 +150,6 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; - *) cd_error_os "CD_OS_ID" ;; esac # variables [ "${CD_CA_1}" ] && CD_CA=true From 1d29cdf637d16182992fd6b02c3246edfc208994 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:10:35 +0200 Subject: [PATCH 161/392] readme/rocky,ubuntu --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index 89968dc..5123f2b 100644 --- a/readme.md +++ b/readme.md @@ -14,6 +14,7 @@ from various CA, CI, OCI / OS. * [X] Alpine * [X] Debian * [ ] Rocky + * [ ] Ubuntu * [ ] Continuous Integration platforms * [X] GitHub → Gitea → ForgeJo * [X] GitLab @@ -28,6 +29,8 @@ from various CA, CI, OCI / OS. | CD_REPO_ALMA | Alma repository URL | | CD_REPO_ALPINE | Alpine repository URL | | CD_REPO_DEBIAN | Debian repository URL | +| CD_REPO_ROCKY | Rocky repository URL | +| CD_REPO_UBUNTU | Ubuntu repository URL | ## Tasks From a70fa248c067a136d0b79873bb8f1877d4f9db74 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:12:08 +0200 Subject: [PATCH 162/392] wip/rocky,ubuntu --- cd.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cd.sh b/cd.sh index 80e9ee7..8348ba5 100644 --- a/cd.sh +++ b/cd.sh @@ -7,6 +7,8 @@ CD_DEFAULT_DNS="\ CD_DEFAULT_REPO_ALMA="https://repo.almalinux.org/almalinux" CD_DEFAULT_REPO_ALPINE="https://dl-cdn.alpinelinux.org/alpine" CD_DEFAULT_REPO_DEBIAN="https://deb.debian.org/debian" +CD_DEFAULT_REPO_ROCKY="http://dl.rockylinux.org/\$contentdir" +CD_DEFAULT_REPO_UBUNTU="http://archive.ubuntu.com/ubuntu" CD_PYTHON_MODULES="\ cd \ @@ -66,6 +68,8 @@ cd_set_environment_variables () { CD_PKG_GIT="git" # common case "${CD_OS_ID}" in + "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + ;; esac # case "${CD_OS_ID}" in @@ -505,6 +509,8 @@ CD_ERROR_OS=1 CD_OS_ALMA="alma" CD_OS_ALPINE="alpine" CD_OS_DEBIAN="debian" +CD_OS_ROCKY="rocky" +CD_OS_UBUNTU="ubuntu" # run cd_main From dcd919e8a811bdca940071d92dbe9d7637188f06 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:25:36 +0200 Subject: [PATCH 163/392] wip/os --- cd.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/cd.sh b/cd.sh index 8348ba5..81e4e8f 100644 --- a/cd.sh +++ b/cd.sh @@ -46,22 +46,27 @@ cd_set_environment_variables () { # operating system CD_OS_ID="$(cd_grep_os ID)" case "${CD_OS_ID}" in - "almalinux") - CD_OS_ID="${CD_OS_ALMA}" + "almalinux") CD_OS_ID="${CD_OS_ALMA}" ;; + "alpine") CD_OS_ID="${CD_OS_ALPINE}" ;; + "debian") CD_OS_ID="${CD_OS_DEBIAN}" ;; + "rocky") CD_OS_ID="${CD_OS_ROCKY}" ;; + "ubuntu") CD_OS_ID="${CD_OS_UBUNTU}" ;; + *) cd_error_os "CD_OS_ID" ;; + esac + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" + ;; + "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") CD_OS_VERSION=$(cd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\)\..*|\1|") ;; - "alpine") - CD_OS_ID="${CD_OS_ALPINE}" + "${CD_OS_ALPINE}") CD_OS_VERSION=$(cd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") ;; - "debian") - CD_OS_ID="${CD_OS_DEBIAN}" - CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" - ;; - *) cd_error_os "CD_OS_ID" ;; esac + cd_echo "CD_OS_ID" "CD_OS_VERSION" # universal CD_DNS_FILE="/etc/resolv.conf" CD_PKG_CA="ca-certificates" @@ -182,7 +187,6 @@ Dir::Etc::SourceParts \"\"; CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # - cd_echo "CD_OS_ID" "CD_OS_VERSION" cd_split cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" cd_split From 3a5350654d08cc4e0dc549f6cc1bc38b29ba9df6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:28:26 +0200 Subject: [PATCH 164/392] rockylinux --- .forgejo/workflows/rockylinux:8.yaml | 13 +++++++++++++ .forgejo/workflows/rockylinux:9.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .forgejo/workflows/rockylinux:8.yaml create mode 100644 .forgejo/workflows/rockylinux:9.yaml diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml new file mode 100644 index 0000000..14b52d2 --- /dev/null +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: rockylinux:8 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml new file mode 100644 index 0000000..a29242e --- /dev/null +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: rockylinux:9 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace From fb2ccf9cbcaf0e68cfc1b85e699591456e08d643 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:30:35 +0200 Subject: [PATCH 165/392] ubuntu --- .forgejo/workflows/ubuntu:mantic.yaml | 13 +++++++++++++ .forgejo/workflows/ubuntu:noble.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .forgejo/workflows/ubuntu:mantic.yaml create mode 100644 .forgejo/workflows/ubuntu:noble.yaml diff --git a/.forgejo/workflows/ubuntu:mantic.yaml b/.forgejo/workflows/ubuntu:mantic.yaml new file mode 100644 index 0000000..4dc9767 --- /dev/null +++ b/.forgejo/workflows/ubuntu:mantic.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: ubuntu:mantic + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml new file mode 100644 index 0000000..e620719 --- /dev/null +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: ubuntu:noble + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace From 7d4538b523c35318ef7a5a2eac456c112efa9f61 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:37:32 +0200 Subject: [PATCH 166/392] wip/universal --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 81e4e8f..235813b 100644 --- a/cd.sh +++ b/cd.sh @@ -71,6 +71,8 @@ cd_set_environment_variables () { CD_DNS_FILE="/etc/resolv.conf" CD_PKG_CA="ca-certificates" CD_PKG_GIT="git" + cd_split + cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" # common case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") @@ -188,8 +190,6 @@ Dir::Etc::SourceParts \"\"; CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # cd_split - cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" - cd_split cd_echo "CD_CA_ROOT" cd_split cd_echo "CD_CMD_CA" \ From db70b8fbbfc9ccf0f8208dc055ff9ba9be41782d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:47:07 +0200 Subject: [PATCH 167/392] wip/shared --- cd.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 235813b..f92cd02 100644 --- a/cd.sh +++ b/cd.sh @@ -73,11 +73,18 @@ cd_set_environment_variables () { CD_PKG_GIT="git" cd_split cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" - # common + # shared case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + ;; + "${CD_OS_ALPINE}"|"${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_CA_ROOT="/usr/local/share/ca-certificates" ;; esac + cd_split + cd_echo "CD_CA_ROOT" + # common # case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -87,7 +94,6 @@ cd_set_environment_variables () { "8"|"9") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" CD_CMD_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" @@ -116,7 +122,6 @@ skip_if_unavailable=False "3.18"|"3.19") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apk cache purge" CD_CMD_INSTALL="apk add" @@ -141,7 +146,6 @@ skip_if_unavailable=False "bullseye") CD_PYTHON_COMMAND="python3.9" ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apt-get clean" CD_CMD_INSTALL="apt-get install --assume-yes" @@ -190,8 +194,6 @@ Dir::Etc::SourceParts \"\"; CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # cd_split - cd_echo "CD_CA_ROOT" - cd_split cd_echo "CD_CMD_CA" \ "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split From 7688ea0221ef92cb35276a0c96d0de0d242e1031 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:50:43 +0200 Subject: [PATCH 168/392] wip/shared --- cd.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index f92cd02..b9ded73 100644 --- a/cd.sh +++ b/cd.sh @@ -77,14 +77,24 @@ cd_set_environment_variables () { case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" + CD_CMD_CA="update-ca-trust" ;; "${CD_OS_ALPINE}"|"${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_CMD_CA="update-ca-certificates" ;; esac cd_split - cd_echo "CD_CA_ROOT" + cd_echo "CD_CA_ROOT" "CD_CMD_CA" # common + case "${CD_OS_ID}" in + "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + ;; + "${CD_OS_ALPINE}") + ;; + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + ;; + esac # case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -94,7 +104,6 @@ cd_set_environment_variables () { "8"|"9") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CA="update-ca-trust" CD_CMD_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_UPDATE="dnf makecache" @@ -122,7 +131,6 @@ skip_if_unavailable=False "3.18"|"3.19") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apk cache purge" CD_CMD_INSTALL="apk add" CD_CMD_UPDATE="apk update" @@ -146,7 +154,6 @@ skip_if_unavailable=False "bullseye") CD_PYTHON_COMMAND="python3.9" ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CA="update-ca-certificates" CD_CMD_CLEAN="apt-get clean" CD_CMD_INSTALL="apt-get install --assume-yes" CD_CMD_UPDATE="apt-get update" @@ -194,8 +201,7 @@ Dir::Etc::SourceParts \"\"; CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # cd_split - cd_echo "CD_CMD_CA" \ - "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" + cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PKG_PKG" cd_split From 1181e2411f140299bedb13bbd605683cfbc95671 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 17:54:04 +0200 Subject: [PATCH 169/392] wip/clean,install,update,upgrade --- cd.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cd.sh b/cd.sh index b9ded73..a2cc590 100644 --- a/cd.sh +++ b/cd.sh @@ -89,12 +89,26 @@ cd_set_environment_variables () { # common case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + CD_CMD_CLEAN="dnf clean all" + CD_CMD_INSTALL="dnf install --assumeyes" + CD_CMD_UPDATE="dnf makecache" + CD_CMD_UPGRADE="dnf upgrade --assumeyes" ;; "${CD_OS_ALPINE}") + CD_CMD_CLEAN="apk cache purge" + CD_CMD_INSTALL="apk add" + CD_CMD_UPDATE="apk update" + CD_CMD_UPGRADE="apk upgrade" ;; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_CMD_CLEAN="apt-get clean" + CD_CMD_INSTALL="apt-get install --assume-yes" + CD_CMD_UPDATE="apt-get update" + CD_CMD_UPGRADE="apt-get upgrade --assume-yes" ;; esac + cd_split + cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" # case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -104,10 +118,6 @@ cd_set_environment_variables () { "8"|"9") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CLEAN="dnf clean all" - CD_CMD_INSTALL="dnf install --assumeyes" - CD_CMD_UPDATE="dnf makecache" - CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_TEXT="\ @@ -131,10 +141,6 @@ skip_if_unavailable=False "3.18"|"3.19") ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CLEAN="apk cache purge" - CD_CMD_INSTALL="apk add" - CD_CMD_UPDATE="apk update" - CD_CMD_UPGRADE="apk upgrade" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" @@ -154,10 +160,6 @@ skip_if_unavailable=False "bullseye") CD_PYTHON_COMMAND="python3.9" ;; *) cd_error_os "CD_OS_VERSION" ;; esac - CD_CMD_CLEAN="apt-get clean" - CD_CMD_INSTALL="apt-get install --assume-yes" - CD_CMD_UPDATE="apt-get update" - CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" CD_PM_CONF_TEXT="\ @@ -201,8 +203,6 @@ Dir::Etc::SourceParts \"\"; CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # cd_split - cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" - cd_split cd_echo "CD_PKG_PKG" cd_split cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" From 61c2ab7f7f40bb8ab213e20683c677e93e69aa3a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 18:00:01 +0200 Subject: [PATCH 170/392] wip/todo --- cd.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index a2cc590..f4b53ba 100644 --- a/cd.sh +++ b/cd.sh @@ -109,7 +109,7 @@ cd_set_environment_variables () { esac cd_split cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" - # + # TODO case "${CD_OS_ID}" in "${CD_OS_ALMA}") CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" @@ -175,6 +175,12 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; esac + cd_split + cd_echo "CD_PKG_PKG" + cd_split + cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" + cd_split + cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" # variables [ "${CD_CA_1}" ] && CD_CA=true # continuous integration platform @@ -203,12 +209,6 @@ Dir::Etc::SourceParts \"\"; CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # cd_split - cd_echo "CD_PKG_PKG" - cd_split - cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" - cd_split - cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" - cd_split cd_echo "CD_CA" cd_split cd_echo "CD_SERVER_URL" \ From 0c17f026ea0bb30be5a929be3325acd76198eb87 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 18:16:12 +0200 Subject: [PATCH 171/392] wip/conf,https --- cd.sh | 84 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/cd.sh b/cd.sh index f4b53ba..251169f 100644 --- a/cd.sh +++ b/cd.sh @@ -93,32 +93,6 @@ cd_set_environment_variables () { CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" - ;; - "${CD_OS_ALPINE}") - CD_CMD_CLEAN="apk cache purge" - CD_CMD_INSTALL="apk add" - CD_CMD_UPDATE="apk update" - CD_CMD_UPGRADE="apk upgrade" - ;; - "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") - CD_CMD_CLEAN="apt-get clean" - CD_CMD_INSTALL="apt-get install --assume-yes" - CD_CMD_UPDATE="apt-get update" - CD_CMD_UPGRADE="apt-get upgrade --assume-yes" - ;; - esac - cd_split - cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" - # TODO - case "${CD_OS_ID}" in - "${CD_OS_ALMA}") - CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" - [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" - case "${CD_OS_VERSION}" in - "8"|"9") ;; - *) cd_error_os "CD_OS_VERSION" ;; - esac - CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_TEXT="\ [main] @@ -130,6 +104,48 @@ skip_if_unavailable=False " CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_PM_HTTPS_TEXT="sslverify=False" + ;; + "${CD_OS_ALPINE}") + CD_CMD_CLEAN="apk cache purge" + CD_CMD_INSTALL="apk add" + CD_CMD_UPDATE="apk update" + CD_CMD_UPGRADE="apk upgrade" + CD_PM_CONF_PATH="" + CD_PM_CONF_TEXT="" + CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" + CD_PM_HTTPS_TEXT="--no-verify" + ;; + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_CMD_CLEAN="apt-get clean" + CD_CMD_INSTALL="apt-get install --assume-yes" + CD_CMD_UPDATE="apt-get update" + CD_CMD_UPGRADE="apt-get upgrade --assume-yes" + CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" + CD_PM_CONF_TEXT="\ +Acquire::Check-Valid-Until True; +APT::Get::Show-Versions True; +APT::Install-Recommends False; +APT::Install-Suggests False; +Dir::Etc::SourceParts \"\"; +" + CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" + CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;" + ;; + esac + cd_split + cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" + cd_split + cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" + # TODO + case "${CD_OS_ID}" in + "${CD_OS_ALMA}") + CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" + [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" + case "${CD_OS_VERSION}" in + "8"|"9") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + CD_PKG_PKG="" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -142,10 +158,6 @@ skip_if_unavailable=False *) cd_error_os "CD_OS_VERSION" ;; esac CD_PKG_PKG="" - CD_PM_CONF_PATH="" - CD_PM_CONF_TEXT="" - CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" - CD_PM_HTTPS_TEXT="--no-verify" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" @@ -161,16 +173,6 @@ skip_if_unavailable=False *) cd_error_os "CD_OS_VERSION" ;; esac CD_PKG_PKG="apt-utils" - CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" - CD_PM_CONF_TEXT="\ -Acquire::Check-Valid-Until True; -APT::Get::Show-Versions True; -APT::Install-Recommends False; -APT::Install-Suggests False; -Dir::Etc::SourceParts \"\"; -" - CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" - CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;" CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; @@ -178,8 +180,6 @@ Dir::Etc::SourceParts \"\"; cd_split cd_echo "CD_PKG_PKG" cd_split - cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" - cd_split cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" # variables [ "${CD_CA_1}" ] && CD_CA=true From 0470fa8de80162dedeaa5f140c9520793a1b283c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 18:27:32 +0200 Subject: [PATCH 172/392] wip/versions --- cd.sh | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 251169f..d8e02dc 100644 --- a/cd.sh +++ b/cd.sh @@ -66,6 +66,32 @@ cd_set_environment_variables () { | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") ;; esac + case "${CD_OS_ID}" in + "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + case "${CD_OS_VERSION}" in + "8"|"9") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + ;; + "${CD_OS_ALPINE}") + case "${CD_OS_VERSION}" in + "3.18"|"3.19") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + ;; + "${CD_OS_DEBIAN}") + case "${CD_OS_VERSION}" in + "bookworm"|"bullseye") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + ;; + "${CD_OS_UBUNTU}") + case "${CD_OS_VERSION}" in + "noble"|"mantic") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + ;; + esac cd_echo "CD_OS_ID" "CD_OS_VERSION" # universal CD_DNS_FILE="/etc/resolv.conf" @@ -141,10 +167,6 @@ Dir::Etc::SourceParts \"\"; "${CD_OS_ALMA}") CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" - case "${CD_OS_VERSION}" in - "8"|"9") ;; - *) cd_error_os "CD_OS_VERSION" ;; - esac CD_PKG_PKG="" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" @@ -153,10 +175,6 @@ Dir::Etc::SourceParts \"\"; "${CD_OS_ALPINE}") CD_OS_REPO="${CD_DEFAULT_REPO_ALPINE}" [ "${CD_REPO_ALPINE}" ] && CD_OS_REPO="${CD_REPO_ALPINE}" - case "${CD_OS_VERSION}" in - "3.18"|"3.19") ;; - *) cd_error_os "CD_OS_VERSION" ;; - esac CD_PKG_PKG="" CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3" From 033b2b84938be8295ebed8a9b261e40bbed1ce14 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 18:54:24 +0200 Subject: [PATCH 173/392] wip/python --- cd.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/cd.sh b/cd.sh index d8e02dc..fc11d76 100644 --- a/cd.sh +++ b/cd.sh @@ -162,43 +162,51 @@ Dir::Etc::SourceParts \"\"; cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" + # TODO python + case "${CD_OS_ID}" in + "${CD_OS_ALMA}") + CD_PYTHON_COMMAND="python3.11" + CD_PYTHON_PACKAGE="python3.11" + CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" + ;; + "${CD_OS_ALPINE}") + CD_PYTHON_COMMAND="python3.11" + CD_PYTHON_PACKAGE="python3" + CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" + ;; + "${CD_OS_DEBIAN}") + case "${CD_OS_VERSION}" in + "bookworm") CD_PYTHON_COMMAND="python3.11" ;; + "bullseye") CD_PYTHON_COMMAND="python3.9" ;; + esac + CD_PYTHON_PACKAGE="python3" + CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" + ;; + esac + cd_split + cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" # TODO case "${CD_OS_ID}" in "${CD_OS_ALMA}") CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" CD_PKG_PKG="" - CD_PYTHON_COMMAND="python3.11" - CD_PYTHON_PACKAGE="python3.11" - CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; "${CD_OS_ALPINE}") CD_OS_REPO="${CD_DEFAULT_REPO_ALPINE}" [ "${CD_REPO_ALPINE}" ] && CD_OS_REPO="${CD_REPO_ALPINE}" CD_PKG_PKG="" - CD_PYTHON_COMMAND="python3.11" - CD_PYTHON_PACKAGE="python3" - CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" ;; "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" # CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" - case "${CD_OS_VERSION}" in - "bookworm") CD_PYTHON_COMMAND="python3.11" ;; - "bullseye") CD_PYTHON_COMMAND="python3.9" ;; - *) cd_error_os "CD_OS_VERSION" ;; - esac CD_PKG_PKG="apt-utils" - CD_PYTHON_PACKAGE="python3" - CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; esac cd_split cd_echo "CD_PKG_PKG" - cd_split - cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" # variables [ "${CD_CA_1}" ] && CD_CA=true # continuous integration platform From 53923ea1f012923618b4271d2314991394f976bc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 19:33:07 +0200 Subject: [PATCH 174/392] wip/url --- cd.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cd.sh b/cd.sh index fc11d76..f37ace3 100644 --- a/cd.sh +++ b/cd.sh @@ -162,6 +162,16 @@ Dir::Etc::SourceParts \"\"; cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" + # specific + case "${CD_OS_ID}" in + "${CD_OS_ALMA}") CD_PM_URL="https://repo.almalinux.org/almalinux" ;; + "${CD_OS_ALPINE}") CD_PM_URL="https://dl-cdn.alpinelinux.org/alpine" ;; + "${CD_OS_DEBIAN}") CD_PM_URL="http://deb.debian.org/debian" ;; + "${CD_OS_ROCKY}") CD_PM_URL="http://dl.rockylinux.org/\$contentdir" ;; + "${CD_OS_UBUNTU}") CD_PM_URL="http://archive.ubuntu.com/ubuntu" ;; + esac + cd_split + cd_echo "CD_PM_URL" # TODO python case "${CD_OS_ID}" in "${CD_OS_ALMA}") From 87a9a73f6cf814c4dff2b43fe6248364c7155c3c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 19:43:35 +0200 Subject: [PATCH 175/392] defaults --- cd.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cd.sh b/cd.sh index f37ace3..bfe12fe 100644 --- a/cd.sh +++ b/cd.sh @@ -4,11 +4,6 @@ CD_DEFAULT_DNS="\ 9.9.9.9 \ " -CD_DEFAULT_REPO_ALMA="https://repo.almalinux.org/almalinux" -CD_DEFAULT_REPO_ALPINE="https://dl-cdn.alpinelinux.org/alpine" -CD_DEFAULT_REPO_DEBIAN="https://deb.debian.org/debian" -CD_DEFAULT_REPO_ROCKY="http://dl.rockylinux.org/\$contentdir" -CD_DEFAULT_REPO_UBUNTU="http://archive.ubuntu.com/ubuntu" CD_PYTHON_MODULES="\ cd \ From f9b39eeb1502554d439fec36bdd793c47414a87b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 20:17:46 +0200 Subject: [PATCH 176/392] wip/url --- cd.sh | 49 +++++++++++++++++++++++++++++++++++++------------ readme.md | 28 +++++++++++++++++++--------- 2 files changed, 56 insertions(+), 21 deletions(-) diff --git a/cd.sh b/cd.sh index bfe12fe..82b9beb 100644 --- a/cd.sh +++ b/cd.sh @@ -159,14 +159,45 @@ Dir::Etc::SourceParts \"\"; cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific case "${CD_OS_ID}" in - "${CD_OS_ALMA}") CD_PM_URL="https://repo.almalinux.org/almalinux" ;; - "${CD_OS_ALPINE}") CD_PM_URL="https://dl-cdn.alpinelinux.org/alpine" ;; - "${CD_OS_DEBIAN}") CD_PM_URL="http://deb.debian.org/debian" ;; - "${CD_OS_ROCKY}") CD_PM_URL="http://dl.rockylinux.org/\$contentdir" ;; - "${CD_OS_UBUNTU}") CD_PM_URL="http://archive.ubuntu.com/ubuntu" ;; + "${CD_OS_ALMA}") + CD_URL_DEFAULT="https://repo.almalinux.org/almalinux" + ;; + "${CD_OS_ALPINE}") + CD_URL_DEFAULT="https://dl-cdn.alpinelinux.org/alpine" + ;; + "${CD_OS_DEBIAN}") + CD_URL_DEFAULT="http://deb.debian.org/debian" + ;; + "${CD_OS_ROCKY}") + CD_URL_DEFAULT="http://dl.rockylinux.org/\$contentdir" + ;; + "${CD_OS_UBUNTU}") + CD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu" + ;; + esac + CD_URL_CHOSEN="${CD_URL_DEFAULT}" + case "${CD_OS_ID}" in + "${CD_OS_ALMA}") + [ "${CD_URL_ALMA}" ] && CD_URL_CHOSEN="${CD_URL_ALMA}" + ;; + "${CD_OS_ALPINE}") + [ "${CD_URL_ALPINE}" ] && CD_URL_CHOSEN="${CD_URL_ALPINE}" + ;; + "${CD_OS_DEBIAN}") + [ "${CD_URL_DEBIAN}" ] && CD_URL_CHOSEN="${CD_URL_DEBIAN}" \ + || CD_URL_CHOSEN="https://deb.debian.org/debian" + ;; + "${CD_OS_ROCKY}") + [ "${CD_URL_ROCKY}" ] && CD_URL_CHOSEN="${CD_URL_ROCKY}" \ + || CD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" + ;; + "${CD_OS_UBUNTU}") + [ "${CD_URL_UBUNTU}" ] && CD_URL_CHOSEN="${CD_URL_UBUNTU}" \ + || CD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" + ;; esac cd_split - cd_echo "CD_PM_URL" + cd_echo "CD_URL_DEFAULT" "CD_URL_CHOSEN" # TODO python case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -193,20 +224,14 @@ Dir::Etc::SourceParts \"\"; # TODO case "${CD_OS_ID}" in "${CD_OS_ALMA}") - CD_OS_REPO="${CD_DEFAULT_REPO_ALMA}" - [ "${CD_REPO_ALMA}" ] && CD_OS_REPO="${CD_REPO_ALMA}" CD_PKG_PKG="" ;; "${CD_OS_ALPINE}") - CD_OS_REPO="${CD_DEFAULT_REPO_ALPINE}" - [ "${CD_REPO_ALPINE}" ] && CD_OS_REPO="${CD_REPO_ALPINE}" CD_PKG_PKG="" ;; "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" # - CD_OS_REPO="${CD_DEFAULT_REPO_DEBIAN}" - [ "${CD_REPO_DEBIAN}" ] && CD_OS_REPO="${CD_REPO_DEBIAN}" CD_PKG_PKG="apt-utils" ;; esac diff --git a/readme.md b/readme.md index 5123f2b..4a7980e 100644 --- a/readme.md +++ b/readme.md @@ -11,10 +11,20 @@ from various CA, CI, OCI / OS. * [X] known CA certificates * [ ] Operating Systems * [X] Alma + * [X] 9 + * [X] 8 * [X] Alpine + * [X] 3.19 + * [X] 3.18 * [X] Debian + * [X] Bookworm + * [X] Bullseye * [ ] Rocky + * [ ] 9 + * [ ] 8 * [ ] Ubuntu + * [ ] Noble + * [ ] Mantic * [ ] Continuous Integration platforms * [X] GitHub → Gitea → ForgeJo * [X] GitLab @@ -22,15 +32,15 @@ from various CA, CI, OCI / OS. ## How -| Variable | Description | -|:---------------|:------------------------| -| CD_CA_n | Numbered CA certificate | -| CD_DNS | Space separated servers | -| CD_REPO_ALMA | Alma repository URL | -| CD_REPO_ALPINE | Alpine repository URL | -| CD_REPO_DEBIAN | Debian repository URL | -| CD_REPO_ROCKY | Rocky repository URL | -| CD_REPO_UBUNTU | Ubuntu repository URL | +| Variable | Description | +|:--------------|:------------------------| +| CD_CA_n | Numbered CA certificate | +| CD_DNS | Space separated servers | +| CD_URL_ALMA | Alma repository URL | +| CD_URL_ALPINE | Alpine repository URL | +| CD_URL_DEBIAN | Debian repository URL | +| CD_URL_ROCKY | Rocky repository URL | +| CD_URL_UBUNTU | Ubuntu repository URL | ## Tasks From bd78de879a2f697fd4b51174ebd7effa92a04327 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 20:35:29 +0200 Subject: [PATCH 177/392] wip/python --- cd.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 82b9beb..fd72456 100644 --- a/cd.sh +++ b/cd.sh @@ -198,9 +198,9 @@ Dir::Etc::SourceParts \"\"; esac cd_split cd_echo "CD_URL_DEFAULT" "CD_URL_CHOSEN" - # TODO python + # python case "${CD_OS_ID}" in - "${CD_OS_ALMA}") + "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" @@ -218,6 +218,14 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; + "${CD_OS_UBUNTU}") + case "${CD_OS_VERSION}" in + "noble") CD_PYTHON_COMMAND="python3.12" ;; + "mantic") CD_PYTHON_COMMAND="python3.11" ;; + esac + CD_PYTHON_PACKAGE="python3" + CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" + ;; esac cd_split cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" From 2ac9ad2ff2c5511ebeb257fb46ec50c5e612edbf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 20:38:46 +0200 Subject: [PATCH 178/392] duplicate --- cd.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index fd72456..2f0e66f 100644 --- a/cd.sh +++ b/cd.sh @@ -385,10 +385,8 @@ cd_update_ca_certificates () { } cd_set_https_verification_on () { - if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then - cd_step "Set HTTPS verification on" - cd_rm "${CD_PM_HTTPS_PATH}" - fi + cd_step "Set HTTPS verification on" + cd_rm "${CD_PM_HTTPS_PATH}" } cd_upgrade_packages () { From cea770999857fc49396f1024446e060f3865eb64 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 21:34:10 +0200 Subject: [PATCH 179/392] sed/cat --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 2f0e66f..fac2b70 100644 --- a/cd.sh +++ b/cd.sh @@ -292,7 +292,6 @@ local file "|^mirrorlist|# mirrorlist|" \ "|${CD_DEFAULT_REPO_ALMA}|${CD_OS_REPO}|" \ "|^# baseurl|baseurl|" - cd_cat "${file}" ;; "${CD_OS_ALPINE}") file="/etc/apk/repositories" @@ -544,6 +543,7 @@ local file for expression in "${@}" ; do sed --in-place "s${expression}g" "${file}" || exit done + cd_cat "${file}" fi } From 7c0908b120cafc83a72c087c0dd1901e2c431148 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 21:39:20 +0200 Subject: [PATCH 180/392] wip/todo --- cd.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cd.sh b/cd.sh index fac2b70..63aad9a 100644 --- a/cd.sh +++ b/cd.sh @@ -309,6 +309,11 @@ deb ${CD_OS_REPO} ${CD_OS_VERSION}-updates main deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main " ;; + # TODO + "${CD_OS_ROCKY}") + ;; + "${CD_OS_UBUNTU}") + ;; esac } From 1b5ef403c704122f341865c58832ad25a9a981ed Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 22:20:41 +0200 Subject: [PATCH 181/392] wip/pkg --- cd.sh | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/cd.sh b/cd.sh index 63aad9a..500b144 100644 --- a/cd.sh +++ b/cd.sh @@ -114,6 +114,7 @@ cd_set_environment_variables () { CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" + CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_TEXT="\ [main] @@ -131,6 +132,7 @@ skip_if_unavailable=False CD_CMD_INSTALL="apk add" CD_CMD_UPDATE="apk update" CD_CMD_UPGRADE="apk upgrade" + CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" @@ -141,6 +143,7 @@ skip_if_unavailable=False CD_CMD_INSTALL="apt-get install --assume-yes" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" + CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" CD_PM_CONF_TEXT="\ Acquire::Check-Valid-Until True; @@ -156,7 +159,7 @@ Dir::Etc::SourceParts \"\"; cd_split cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split - cd_echo "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" + cd_echo "CD_PKG_PKG" "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific case "${CD_OS_ID}" in "${CD_OS_ALMA}") @@ -231,20 +234,10 @@ Dir::Etc::SourceParts \"\"; cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" # TODO case "${CD_OS_ID}" in - "${CD_OS_ALMA}") - CD_PKG_PKG="" - ;; - "${CD_OS_ALPINE}") - CD_PKG_PKG="" - ;; "${CD_OS_DEBIAN}") export DEBIAN_FRONTEND="noninteractive" - # - CD_PKG_PKG="apt-utils" ;; esac - cd_split - cd_echo "CD_PKG_PKG" # variables [ "${CD_CA_1}" ] && CD_CA=true # continuous integration platform From 1652a1545bf872fb6a2789ee3d7f13da465ab23e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 22:36:30 +0200 Subject: [PATCH 182/392] wip/pkgconf --- cd.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cd.sh b/cd.sh index 500b144..f61491a 100644 --- a/cd.sh +++ b/cd.sh @@ -14,9 +14,9 @@ rwx \ cd_main () { cd_set_environment_variables cd_set_packages_repositories + cd_set_packages_configuration # cd_list_working_directory - cd_set_packages_configuration cd_set_https_verification_off cd_set_dns_resolving cd_update_packages_catalog @@ -232,12 +232,6 @@ Dir::Etc::SourceParts \"\"; esac cd_split cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" - # TODO - case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}") - export DEBIAN_FRONTEND="noninteractive" - ;; - esac # variables [ "${CD_CA_1}" ] && CD_CA=true # continuous integration platform @@ -310,6 +304,16 @@ deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main esac } +cd_set_packages_configuration () { + cd_step "Set packages configuration" + cd_write "${CD_PM_CONF_PATH}" "${CD_PM_CONF_TEXT}" + case "${CD_OS_ID}" in + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + export DEBIAN_FRONTEND="noninteractive" + ;; + esac +} + # agnostic steps cd_list_working_directory () { @@ -317,12 +321,8 @@ cd_list_working_directory () { cd_ls "." } -cd_set_packages_configuration () { - cd_step "Set packages configuration" - cd_write "${CD_PM_CONF_PATH}" "${CD_PM_CONF_TEXT}" -} - cd_set_https_verification_off () { + # TODO if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then cd_step "Set HTTPS verification off" cd_mkdir "$(dirname "${CD_PM_HTTPS_PATH}")" From 8503de45557eb65b444f63532beb6404860ba6d6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 22:51:23 +0200 Subject: [PATCH 183/392] wip/redhat --- cd.sh | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/cd.sh b/cd.sh index f61491a..7975e14 100644 --- a/cd.sh +++ b/cd.sh @@ -274,31 +274,42 @@ local file cd_step "Set packages repositories" case "${CD_OS_ID}" in "${CD_OS_ALMA}") - file="/etc/yum.repos.d/almalinux.repo" + case "${CD_OS_VERSION}" in + "8") file="/etc/yum.repos.d/almalinux.repo" ;; + "9") file="/etc/yum.repos.d/almalinux-baseos.repo" ;; + esac cd_sed "${file}" \ "|^mirrorlist|# mirrorlist|" \ - "|${CD_DEFAULT_REPO_ALMA}|${CD_OS_REPO}|" \ + "|${CD_DEFAULT_REPO_ALMA}|${CD_URL_CHOSEN}|" \ "|^# baseurl|baseurl|" ;; "${CD_OS_ALPINE}") file="/etc/apk/repositories" cd_write "${file}" "\ -${CD_OS_REPO}/v${CD_OS_VERSION}/main -${CD_OS_REPO}/v${CD_OS_VERSION}/community +${CD_URL_CHOSEN}/v${CD_OS_VERSION}/main +${CD_URL_CHOSEN}/v${CD_OS_VERSION}/community " ;; "${CD_OS_DEBIAN}") file="/etc/apt/sources.list" cd_write "${file}" "\ -deb ${CD_OS_REPO} ${CD_OS_VERSION} main -deb ${CD_OS_REPO} ${CD_OS_VERSION}-backports main -deb ${CD_OS_REPO} ${CD_OS_VERSION}-updates main -deb ${CD_OS_REPO}-security ${CD_OS_VERSION}-security main +deb ${CD_URL_CHOSEN} ${CD_OS_VERSION} main +deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-backports main +deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-updates main +deb ${CD_URL_CHOSEN}-security ${CD_OS_VERSION}-security main " ;; - # TODO "${CD_OS_ROCKY}") + case "${CD_OS_VERSION}" in + "8") file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; + "9") file="/etc/yum.repos.d/rocky.repo" ;; + esac + cd_sed "${file}" \ + "|^mirrorlist|# mirrorlist|" \ + "|${CD_DEFAULT_REPO_ALMA}|${CD_URL_CHOSEN}|" \ + "|^#baseurl|baseurl|" ;; + # TODO "${CD_OS_UBUNTU}") ;; esac From 0f8834a050b2bcf2a5e06abe5b273a901a55be68 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 22:57:17 +0200 Subject: [PATCH 184/392] github --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 7975e14..9bc03b0 100644 --- a/cd.sh +++ b/cd.sh @@ -236,7 +236,7 @@ Dir::Etc::SourceParts \"\"; [ "${CD_CA_1}" ] && CD_CA=true # continuous integration platform if [ "${GITHUB_ACTIONS}" ] ; then - # forgejo / gitea / github + # github → gitea → forgejo CD_SERVER_URL="${GITHUB_SERVER_URL}" CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" From d92eac13fa4ea101f2a283ad6f947d8ff7b4b618 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 23:47:31 +0200 Subject: [PATCH 185/392] ubuntu --- cd.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 9bc03b0..16a189c 100644 --- a/cd.sh +++ b/cd.sh @@ -309,8 +309,14 @@ deb ${CD_URL_CHOSEN}-security ${CD_OS_VERSION}-security main "|${CD_DEFAULT_REPO_ALMA}|${CD_URL_CHOSEN}|" \ "|^#baseurl|baseurl|" ;; - # TODO "${CD_OS_UBUNTU}") + file="/etc/apt/sources.list" + cd_write "${file}" "\ +deb ${CD_URL_CHOSEN} ${CD_OS_VERSION} main +deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-backports main +deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-updates main +deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-security main +" ;; esac } From a0916da0542d778d45f8dcbff4e318d1420e1241 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 23:52:07 +0200 Subject: [PATCH 186/392] readme --- readme.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/readme.md b/readme.md index 4a7980e..2d9139c 100644 --- a/readme.md +++ b/readme.md @@ -11,20 +11,21 @@ from various CA, CI, OCI / OS. * [X] known CA certificates * [ ] Operating Systems * [X] Alma - * [X] 9 * [X] 8 + * [X] 9 * [X] Alpine - * [X] 3.19 * [X] 3.18 + * [X] 3.19 + * [ ] Arch * [X] Debian * [X] Bookworm * [X] Bullseye - * [ ] Rocky - * [ ] 9 - * [ ] 8 - * [ ] Ubuntu - * [ ] Noble - * [ ] Mantic + * [X] Rocky + * [X] 8 + * [X] 9 + * [X] Ubuntu + * [X] Mantic + * [X] Noble * [ ] Continuous Integration platforms * [X] GitHub → Gitea → ForgeJo * [X] GitLab @@ -46,10 +47,9 @@ from various CA, CI, OCI / OS. * write bats -* handle cloning credentials -* make steps more agnostic +* handle git cloning credentials * reduce single conditions with && -* write Python bootstrap +* write Python bootstrap process * integrate project repository cloning * override repository and framework locations From 0db2fc61fe2abb2b723cdf7602c381d44845d020 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 4 May 2024 23:58:58 +0200 Subject: [PATCH 187/392] fix --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 16a189c..05827d4 100644 --- a/cd.sh +++ b/cd.sh @@ -280,7 +280,7 @@ local file esac cd_sed "${file}" \ "|^mirrorlist|# mirrorlist|" \ - "|${CD_DEFAULT_REPO_ALMA}|${CD_URL_CHOSEN}|" \ + "|${CD_URL_DEFAULT}|${CD_URL_CHOSEN}|" \ "|^# baseurl|baseurl|" ;; "${CD_OS_ALPINE}") @@ -306,7 +306,7 @@ deb ${CD_URL_CHOSEN}-security ${CD_OS_VERSION}-security main esac cd_sed "${file}" \ "|^mirrorlist|# mirrorlist|" \ - "|${CD_DEFAULT_REPO_ALMA}|${CD_URL_CHOSEN}|" \ + "|${CD_URL_DEFAULT}|${CD_URL_CHOSEN}|" \ "|^#baseurl|baseurl|" ;; "${CD_OS_UBUNTU}") From 96d00e83988a70701f1a593f2416324bfbbae026 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 18:31:28 +0200 Subject: [PATCH 188/392] cmd/query,pkg/ca --- cd.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 05827d4..eb39539 100644 --- a/cd.sh +++ b/cd.sh @@ -90,7 +90,6 @@ cd_set_environment_variables () { cd_echo "CD_OS_ID" "CD_OS_VERSION" # universal CD_DNS_FILE="/etc/resolv.conf" - CD_PKG_CA="ca-certificates" CD_PKG_GIT="git" cd_split cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" @@ -112,8 +111,10 @@ cd_set_environment_variables () { "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") CD_CMD_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" + CD_CMD_QUERY="rpm --query" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" + CD_PKG_CA="ca-certificates" CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_TEXT="\ @@ -130,8 +131,10 @@ skip_if_unavailable=False "${CD_OS_ALPINE}") CD_CMD_CLEAN="apk cache purge" CD_CMD_INSTALL="apk add" + CD_CMD_QUERY="apk info" CD_CMD_UPDATE="apk update" CD_CMD_UPGRADE="apk upgrade" + CD_PKG_CA="ca-certificates-bundle" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" @@ -141,8 +144,10 @@ skip_if_unavailable=False "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_CMD_CLEAN="apt-get clean" CD_CMD_INSTALL="apt-get install --assume-yes" + CD_CMD_QUERY="dpkg-query --show" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" + CD_PKG_CA="ca-certificates" CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" CD_PM_CONF_TEXT="\ @@ -157,7 +162,8 @@ Dir::Etc::SourceParts \"\"; ;; esac cd_split - cd_echo "CD_CMD_CLEAN" "CD_CMD_INSTALL" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" + cd_echo "CD_CMD_CLEAN" \ + "CD_CMD_INSTALL" "CD_CMD_QUERY" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PKG_PKG" "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific From aaed4e15104dca5cb8e332126bb5428e809034be Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 20:01:54 +0200 Subject: [PATCH 189/392] archlinux:bases --- .../workflows/archlinux:base-20231112.0.191179.yaml | 13 +++++++++++++ .../workflows/archlinux:base-20240101.0.204074.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .forgejo/workflows/archlinux:base-20231112.0.191179.yaml create mode 100644 .forgejo/workflows/archlinux:base-20240101.0.204074.yaml diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml new file mode 100644 index 0000000..c672ea1 --- /dev/null +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: archlinux:base-20231112.0.191179 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml new file mode 100644 index 0000000..bac2557 --- /dev/null +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: archlinux:base-20240101.0.204074 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace From a384f858a1400fa73e1b56d113e7ca6e2d91e204 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 20:02:52 +0200 Subject: [PATCH 190/392] id --- cd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cd.sh b/cd.sh index eb39539..f37b71c 100644 --- a/cd.sh +++ b/cd.sh @@ -603,6 +603,7 @@ CD_ERROR_OS=1 CD_OS_ALMA="alma" CD_OS_ALPINE="alpine" +CD_OS_ARCH="arch" CD_OS_DEBIAN="debian" CD_OS_ROCKY="rocky" CD_OS_UBUNTU="ubuntu" From 5a0687d236315a6d1e08f2e03409bb770a58b820 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 20:27:18 +0200 Subject: [PATCH 191/392] arch/id,version --- cd.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index f37b71c..f562f1b 100644 --- a/cd.sh +++ b/cd.sh @@ -43,16 +43,14 @@ cd_set_environment_variables () { case "${CD_OS_ID}" in "almalinux") CD_OS_ID="${CD_OS_ALMA}" ;; "alpine") CD_OS_ID="${CD_OS_ALPINE}" ;; + "arch") CD_OS_ID="${CD_OS_ARCH}" ;; "debian") CD_OS_ID="${CD_OS_DEBIAN}" ;; "rocky") CD_OS_ID="${CD_OS_ROCKY}" ;; "ubuntu") CD_OS_ID="${CD_OS_UBUNTU}" ;; *) cd_error_os "CD_OS_ID" ;; esac case "${CD_OS_ID}" in - "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") - CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" - ;; - "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + "${CD_OS_ALMA}"|"${CD_OS_ARCH}"|"${CD_OS_ROCKY}") CD_OS_VERSION=$(cd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\)\..*|\1|") ;; @@ -60,6 +58,9 @@ cd_set_environment_variables () { CD_OS_VERSION=$(cd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\.[0-9]\+\)\..*|\1|") ;; + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" + ;; esac case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") @@ -74,6 +75,12 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac ;; + "${CD_OS_ARCH}") + case "${CD_OS_VERSION}" in + "20231112"|"20240101") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + ;; "${CD_OS_DEBIAN}") case "${CD_OS_VERSION}" in "bookworm"|"bullseye") ;; @@ -82,7 +89,7 @@ cd_set_environment_variables () { ;; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in - "noble"|"mantic") ;; + "mantic"|"noble") ;; *) cd_error_os "CD_OS_VERSION" ;; esac ;; From fb35fa4710f990e374c3d2f10de2a5ebb61401a1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 20:46:00 +0200 Subject: [PATCH 192/392] arch/python --- cd.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cd.sh b/cd.sh index f562f1b..d193301 100644 --- a/cd.sh +++ b/cd.sh @@ -226,6 +226,11 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" ;; + "${CD_OS_ARCH}") + CD_PYTHON_COMMAND="python3.12" + CD_PYTHON_PACKAGE="python" + CD_PYTHON_PACKAGES="/usr/lib/python3.12/site-packages" + ;; "${CD_OS_DEBIAN}") case "${CD_OS_VERSION}" in "bookworm") CD_PYTHON_COMMAND="python3.11" ;; From 503b307d8b4231468b220046b6ece70b1a4bb8f3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 20:48:37 +0200 Subject: [PATCH 193/392] arch/readme --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 2d9139c..6a80f48 100644 --- a/readme.md +++ b/readme.md @@ -39,6 +39,7 @@ from various CA, CI, OCI / OS. | CD_DNS | Space separated servers | | 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_ROCKY | Rocky repository URL | | CD_URL_UBUNTU | Ubuntu repository URL | From b0ce1b6ce553c739f00579302b6771403bde6407 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 22:06:09 +0200 Subject: [PATCH 194/392] arch/ca --- cd.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cd.sh b/cd.sh index d193301..c65828a 100644 --- a/cd.sh +++ b/cd.sh @@ -106,6 +106,10 @@ cd_set_environment_variables () { CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" ;; + "${CD_OS_ARCH}") + CD_CA_ROOT="/etc/ca-certificates/trust-source/anchors" + CD_CMD_CA="update-ca-trust" + ;; "${CD_OS_ALPINE}"|"${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" From 476c3d2b0d1d1a9915705613c1e5baccc25d3689 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 22:09:26 +0200 Subject: [PATCH 195/392] arch/wip --- cd.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cd.sh b/cd.sh index c65828a..a1b2398 100644 --- a/cd.sh +++ b/cd.sh @@ -152,6 +152,19 @@ skip_if_unavailable=False CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" CD_PM_HTTPS_TEXT="--no-verify" ;; + "${CD_OS_ARCH}") + CD_CMD_CLEAN="pacman --sync --clean --noconfirm" + CD_CMD_INSTALL="pacman --sync --noconfirm" + CD_CMD_QUERY="pacman --query" + CD_CMD_UPDATE="pacman --sync --refresh" + CD_CMD_UPGRADE="pacman --sync --sysupgrade --noconfirm" + # TODO + CD_PKG_PKG="" + CD_PM_CONF_PATH="" + CD_PM_CONF_TEXT="" + # TODO + # TODO + ;; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_CMD_CLEAN="apt-get clean" CD_CMD_INSTALL="apt-get install --assume-yes" From 1c54dcdb9e41904890ce3162192a9a64dd028c43 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 5 May 2024 22:20:49 +0200 Subject: [PATCH 196/392] readme --- readme.md | 55 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/readme.md b/readme.md index 6a80f48..f9d0d44 100644 --- a/readme.md +++ b/readme.md @@ -5,31 +5,36 @@ from various CA, CI, OCI / OS. ## Features -* [ ] support - * [X] package repositories mirror - * [X] custom CA certificates - * [X] known CA certificates - * [ ] Operating Systems - * [X] Alma - * [X] 8 - * [X] 9 - * [X] Alpine - * [X] 3.18 - * [X] 3.19 - * [ ] Arch - * [X] Debian - * [X] Bookworm - * [X] Bullseye - * [X] Rocky - * [X] 8 - * [X] 9 - * [X] Ubuntu - * [X] Mantic - * [X] Noble - * [ ] Continuous Integration platforms - * [X] GitHub → Gitea → ForgeJo - * [X] GitLab - * [ ] SourceHut +* [X] CA certificates + * [X] custom + * [X] known +* [ ] Continuous Integration platforms + * [X] GitHub → Gitea → ForgeJo + * [X] GitLab + * [ ] SourceHut +* [ ] Operating Systems + * [X] Alma + * [X] 8 + * [X] 9 + * [X] Alpine + * [X] 3.18 + * [X] 3.19 + * [ ] Arch + * [ ] 20231112 + * [ ] 20240101 + * [X] Debian + * [X] Bookworm + * [X] Bullseye + * [X] Rocky + * [X] 8 + * [X] 9 + * [X] Ubuntu + * [X] Mantic + * [X] Noble +* [X] Python + * [X] 3.9 (Debian Bullseye) + * [X] 3.11 (Alma, Alpine, Debian Bookworm, Rocky, Ubuntu Mantic) + * [X] 3.12 (Arch, Ubuntu Noble) ## How From b399eeaf7142dd80b8da0d9e527b95ce0f0064db Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 10:07:02 +0200 Subject: [PATCH 197/392] readme/fedora --- readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readme.md b/readme.md index f9d0d44..0ec7612 100644 --- a/readme.md +++ b/readme.md @@ -25,6 +25,9 @@ from various CA, CI, OCI / OS. * [X] Debian * [X] Bookworm * [X] Bullseye + * [ ] Fedora + * [ ] 39 + * [ ] 40 * [X] Rocky * [X] 8 * [X] 9 From 2bf74aab112b3cba9b9b6d22a7dd85d9e08c158e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 11:36:27 +0200 Subject: [PATCH 198/392] fedora/wip --- cd.sh | 26 +++++++++++++++++++++++--- readme.md | 3 ++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index a1b2398..69d4f12 100644 --- a/cd.sh +++ b/cd.sh @@ -45,12 +45,13 @@ cd_set_environment_variables () { "alpine") CD_OS_ID="${CD_OS_ALPINE}" ;; "arch") CD_OS_ID="${CD_OS_ARCH}" ;; "debian") CD_OS_ID="${CD_OS_DEBIAN}" ;; + "fedora") CD_OS_ID="${CD_OS_FEDORA}" ;; "rocky") CD_OS_ID="${CD_OS_ROCKY}" ;; "ubuntu") CD_OS_ID="${CD_OS_UBUNTU}" ;; *) cd_error_os "CD_OS_ID" ;; esac case "${CD_OS_ID}" in - "${CD_OS_ALMA}"|"${CD_OS_ARCH}"|"${CD_OS_ROCKY}") + "${CD_OS_ALMA}"|"${CD_OS_ARCH}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_OS_VERSION=$(cd_grep_os VERSION_ID \ | sed "s|^\([0-9]\+\)\..*|\1|") ;; @@ -87,6 +88,12 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac ;; + "${CD_OS_FEDORA}") + case "${CD_OS_VERSION}" in + "39"|"40") ;; + *) cd_error_os "CD_OS_VERSION" ;; + esac + ;; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in "mantic"|"noble") ;; @@ -102,7 +109,7 @@ cd_set_environment_variables () { cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" # shared case "${CD_OS_ID}" in - "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" ;; @@ -119,7 +126,7 @@ cd_set_environment_variables () { cd_echo "CD_CA_ROOT" "CD_CMD_CA" # common case "${CD_OS_ID}" in - "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") + "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_CMD_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_QUERY="rpm --query" @@ -201,6 +208,9 @@ Dir::Etc::SourceParts \"\"; "${CD_OS_DEBIAN}") CD_URL_DEFAULT="http://deb.debian.org/debian" ;; + "${CD_OS_FEDORA}") + CD_URL_DEFAULT="http://download.example/pub/fedora/linux/releases" + ;; "${CD_OS_ROCKY}") CD_URL_DEFAULT="http://dl.rockylinux.org/\$contentdir" ;; @@ -220,6 +230,10 @@ Dir::Etc::SourceParts \"\"; [ "${CD_URL_DEBIAN}" ] && CD_URL_CHOSEN="${CD_URL_DEBIAN}" \ || CD_URL_CHOSEN="https://deb.debian.org/debian" ;; + "${CD_OS_FEDORA}") + [ "${CD_URL_FEDORA}" ] && CD_URL_CHOSEN="${CD_URL_FEDORA}" \ + || CD_URL_CHOSEN="https://rpmfind.net/linux/fedora/linux/releases" + ;; "${CD_OS_ROCKY}") [ "${CD_URL_ROCKY}" ] && CD_URL_CHOSEN="${CD_URL_ROCKY}" \ || CD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" @@ -256,6 +270,11 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGE="python3" CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; + "${CD_OS_FEDORA}") + CD_PYTHON_COMMAND="python3.12" + CD_PYTHON_PACKAGE="python3" + CD_PYTHON_PACKAGES="/usr/lib64/python3.12/site-packages" + ;; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in "noble") CD_PYTHON_COMMAND="python3.12" ;; @@ -634,6 +653,7 @@ CD_OS_ALMA="alma" CD_OS_ALPINE="alpine" CD_OS_ARCH="arch" CD_OS_DEBIAN="debian" +CD_OS_FEDORA="fedora" CD_OS_ROCKY="rocky" CD_OS_UBUNTU="ubuntu" diff --git a/readme.md b/readme.md index 0ec7612..1fbd687 100644 --- a/readme.md +++ b/readme.md @@ -37,7 +37,7 @@ from various CA, CI, OCI / OS. * [X] Python * [X] 3.9 (Debian Bullseye) * [X] 3.11 (Alma, Alpine, Debian Bookworm, Rocky, Ubuntu Mantic) - * [X] 3.12 (Arch, Ubuntu Noble) + * [X] 3.12 (Arch, Fedora, Ubuntu Noble) ## How @@ -49,6 +49,7 @@ from various CA, CI, OCI / OS. | 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 | From 61093c5710f004217409bdb35ca9e2d0ab5ec7be Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 11:37:37 +0200 Subject: [PATCH 199/392] fedora/workflows --- .forgejo/workflows/fedora:39.yaml | 13 +++++++++++++ .forgejo/workflows/fedora:40.yaml | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .forgejo/workflows/fedora:39.yaml create mode 100644 .forgejo/workflows/fedora:40.yaml diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml new file mode 100644 index 0000000..0f0a195 --- /dev/null +++ b/.forgejo/workflows/fedora:39.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: fedora:39 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml new file mode 100644 index 0000000..beb2f0d --- /dev/null +++ b/.forgejo/workflows/fedora:40.yaml @@ -0,0 +1,13 @@ +on: [push] +jobs: + job: + container: + image: fedora:40 + steps: + - name: cd + env: + CD: ${{secrets.cd}} + run: eval ${{vars.cd}} + + - run: cd-list-environment + - run: cd-browse-workspace From 79939a09e6df5116d49af7bd1469bf5ecc401f9e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 11:45:21 +0200 Subject: [PATCH 200/392] pypackages --- cd.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index 69d4f12..4f96e18 100644 --- a/cd.sh +++ b/cd.sh @@ -250,17 +250,14 @@ Dir::Etc::SourceParts \"\"; "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3.11" - CD_PYTHON_PACKAGES="/usr/lib64/python3.11/site-packages" ;; "${CD_OS_ALPINE}") CD_PYTHON_COMMAND="python3.11" CD_PYTHON_PACKAGE="python3" - CD_PYTHON_PACKAGES="/usr/lib/python3.11/site-packages" ;; "${CD_OS_ARCH}") CD_PYTHON_COMMAND="python3.12" CD_PYTHON_PACKAGE="python" - CD_PYTHON_PACKAGES="/usr/lib/python3.12/site-packages" ;; "${CD_OS_DEBIAN}") case "${CD_OS_VERSION}" in @@ -268,12 +265,10 @@ Dir::Etc::SourceParts \"\"; "bullseye") CD_PYTHON_COMMAND="python3.9" ;; esac CD_PYTHON_PACKAGE="python3" - CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; "${CD_OS_FEDORA}") CD_PYTHON_COMMAND="python3.12" CD_PYTHON_PACKAGE="python3" - CD_PYTHON_PACKAGES="/usr/lib64/python3.12/site-packages" ;; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in @@ -281,6 +276,16 @@ Dir::Etc::SourceParts \"\"; "mantic") CD_PYTHON_COMMAND="python3.11" ;; esac CD_PYTHON_PACKAGE="python3" + ;; + esac + case "${CD_OS_ID}" in + "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") + CD_PYTHON_PACKAGES="/usr/lib64/${CD_PYTHON_COMMAND}/site-packages" + ;; + "${CD_OS_ALPINE}"|"${CD_OS_ARCH}") + CD_PYTHON_PACKAGES="/usr/lib/${CD_PYTHON_COMMAND}/site-packages" + ;; + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" ;; esac From 9827544da46456ea0acbd54309446011329d2cac Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 11:50:31 +0200 Subject: [PATCH 201/392] readme/python --- readme.md | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/readme.md b/readme.md index 1fbd687..7776539 100644 --- a/readme.md +++ b/readme.md @@ -13,31 +13,27 @@ from various CA, CI, OCI / OS. * [X] GitLab * [ ] SourceHut * [ ] Operating Systems - * [X] Alma + * [X] Alma → Python 3.11 * [X] 8 * [X] 9 - * [X] Alpine + * [X] Alpine → Python 3.11 * [X] 3.18 * [X] 3.19 - * [ ] Arch + * [ ] Arch → Python 3.12 * [ ] 20231112 * [ ] 20240101 * [X] Debian - * [X] Bookworm - * [X] Bullseye - * [ ] Fedora + * [X] Bullseye (11) → Python 3.9 + * [X] Bookworm (12) → Python 3.11 + * [ ] Fedora → Python 3.12 * [ ] 39 * [ ] 40 - * [X] Rocky + * [X] Rocky → Python 3.11 * [X] 8 * [X] 9 * [X] Ubuntu - * [X] Mantic - * [X] Noble -* [X] Python - * [X] 3.9 (Debian Bullseye) - * [X] 3.11 (Alma, Alpine, Debian Bookworm, Rocky, Ubuntu Mantic) - * [X] 3.12 (Arch, Fedora, Ubuntu Noble) + * [X] Mantic (23.10) → Python 3.11 + * [X] Noble (24.04) → Python 3.12 ## How From 01de021c693f4ec0b724f7cb48cc81bc2bf01db8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 11:52:37 +0200 Subject: [PATCH 202/392] ubuntu/workflows --- .forgejo/workflows/{ubuntu:mantic.yaml => ubuntu:jammy.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .forgejo/workflows/{ubuntu:mantic.yaml => ubuntu:jammy.yaml} (87%) diff --git a/.forgejo/workflows/ubuntu:mantic.yaml b/.forgejo/workflows/ubuntu:jammy.yaml similarity index 87% rename from .forgejo/workflows/ubuntu:mantic.yaml rename to .forgejo/workflows/ubuntu:jammy.yaml index 4dc9767..ac3ce6d 100644 --- a/.forgejo/workflows/ubuntu:mantic.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -2,7 +2,7 @@ on: [push] jobs: job: container: - image: ubuntu:mantic + image: ubuntu:jammy steps: - name: cd env: From d63ad0db7d3a7ffa4f0c3d93e7ed268fb974487d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 11:55:00 +0200 Subject: [PATCH 203/392] ubuntu/readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 7776539..0f0cca5 100644 --- a/readme.md +++ b/readme.md @@ -32,7 +32,7 @@ from various CA, CI, OCI / OS. * [X] 8 * [X] 9 * [X] Ubuntu - * [X] Mantic (23.10) → Python 3.11 + * [X] Jammy (22.04) → Python 3.10 * [X] Noble (24.04) → Python 3.12 ## How From 4a87d29c682d5c3ff7c2ff796a58131101f47e8f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 11:56:45 +0200 Subject: [PATCH 204/392] ubuntu/versions --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 4f96e18..3afeefb 100644 --- a/cd.sh +++ b/cd.sh @@ -96,7 +96,7 @@ cd_set_environment_variables () { ;; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in - "mantic"|"noble") ;; + "jammy"|"noble") ;; *) cd_error_os "CD_OS_VERSION" ;; esac ;; @@ -273,7 +273,7 @@ Dir::Etc::SourceParts \"\"; "${CD_OS_UBUNTU}") case "${CD_OS_VERSION}" in "noble") CD_PYTHON_COMMAND="python3.12" ;; - "mantic") CD_PYTHON_COMMAND="python3.11" ;; + "jammy") CD_PYTHON_COMMAND="python3.10" ;; esac CD_PYTHON_PACKAGE="python3" ;; From ffab53c4e0f270478b45d19bb528866cdc15b526 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 12:11:40 +0200 Subject: [PATCH 205/392] arch/https --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 3afeefb..79a9791 100644 --- a/cd.sh +++ b/cd.sh @@ -169,8 +169,8 @@ skip_if_unavailable=False CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" - # TODO - # TODO + CD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" + CD_PM_HTTPS_TEXT="SSLVerify = No" ;; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_CMD_CLEAN="apt-get clean" From aa4f0f67caee7c322cc1da9c52ce9e7fdf793dbd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 6 May 2024 13:42:33 +0200 Subject: [PATCH 206/392] arch/default --- cd.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cd.sh b/cd.sh index 79a9791..48830dc 100644 --- a/cd.sh +++ b/cd.sh @@ -205,6 +205,9 @@ Dir::Etc::SourceParts \"\"; "${CD_OS_ALPINE}") CD_URL_DEFAULT="https://dl-cdn.alpinelinux.org/alpine" ;; + "${CD_OS_ARCH}") + CD_URL_DEFAULT="https://geo.mirror.pkgbuild.com" + ;; "${CD_OS_DEBIAN}") CD_URL_DEFAULT="http://deb.debian.org/debian" ;; From 550c00f4dd0ce3774514cdbf009c7a346f92f1ae Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 10 May 2024 22:24:42 +0200 Subject: [PATCH 207/392] arch/pkg/ca --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 48830dc..ace2502 100644 --- a/cd.sh +++ b/cd.sh @@ -165,7 +165,7 @@ skip_if_unavailable=False CD_CMD_QUERY="pacman --query" CD_CMD_UPDATE="pacman --sync --refresh" CD_CMD_UPGRADE="pacman --sync --sysupgrade --noconfirm" - # TODO + CD_PKG_CA="ca-certificates" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" From 6efaec810fc50e2e379b0b8d5108c4c1145ceb40 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 10 May 2024 22:25:17 +0200 Subject: [PATCH 208/392] https & python --- readme.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/readme.md b/readme.md index 0f0cca5..8b6bf8f 100644 --- a/readme.md +++ b/readme.md @@ -49,6 +49,20 @@ from various CA, CI, OCI / OS. | CD_URL_ROCKY | Rocky repository URL | | CD_URL_UBUNTU | Ubuntu repository URL | +## HTTPS & Python + +| OS img | crt | upd | Python | +|:--------|-----|-----|:---------| +| Alma 8 | [X] | [X] | [ ] | +| Alma 9 | [X] | [X] | [X] 3.9 | +| Alpine | [X] | [ ] | [ ] | +| Arch | [X] | [X] | [ ] | +| Debian | [ ] | [ ] | [ ] | +| Fedora | [X] | [X] | [X] 3.12 | +| Rocky 8 | [X] | [X] | [ ] | +| Rocky 9 | [X] | [X] | [X] 3.9 | +| Ubuntu | [ ] | [ ] | [ ] | + ## Tasks * write bats From aa7d2718a7d75b5675706143496e852bf03cbfa4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 10 May 2024 22:33:13 +0200 Subject: [PATCH 209/392] readme/arch,fedora --- readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 8b6bf8f..d161140 100644 --- a/readme.md +++ b/readme.md @@ -12,22 +12,22 @@ from various CA, CI, OCI / OS. * [X] GitHub → Gitea → ForgeJo * [X] GitLab * [ ] SourceHut -* [ ] Operating Systems +* [X] Operating Systems * [X] Alma → Python 3.11 * [X] 8 * [X] 9 * [X] Alpine → Python 3.11 * [X] 3.18 * [X] 3.19 - * [ ] Arch → Python 3.12 - * [ ] 20231112 - * [ ] 20240101 + * [X] Arch → Python 3.12 + * [X] 20231112 + * [X] 20240101 * [X] Debian * [X] Bullseye (11) → Python 3.9 * [X] Bookworm (12) → Python 3.11 - * [ ] Fedora → Python 3.12 - * [ ] 39 - * [ ] 40 + * [X] Fedora → Python 3.12 + * [X] 39 + * [X] 40 * [X] Rocky → Python 3.11 * [X] 8 * [X] 9 From f2c422c909684be955172584d76310c399787376 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 10 May 2024 22:40:01 +0200 Subject: [PATCH 210/392] ca --- cd.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index ace2502..a680ed3 100644 --- a/cd.sh +++ b/cd.sh @@ -106,24 +106,32 @@ cd_set_environment_variables () { CD_DNS_FILE="/etc/resolv.conf" CD_PKG_GIT="git" cd_split - cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" + cd_echo "CD_DNS_FILE" "CD_PKG_GIT" # shared case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" + CD_PKG_CA="ca-certificates" + ;; + "${CD_OS_ALPINE}") + CD_CA_ROOT="/usr/local/share/ca-certificates" + CD_CMD_CA="update-ca-certificates" + CD_PKG_CA="ca-certificates-bundle" ;; "${CD_OS_ARCH}") CD_CA_ROOT="/etc/ca-certificates/trust-source/anchors" CD_CMD_CA="update-ca-trust" + CD_PKG_CA="ca-certificates" ;; - "${CD_OS_ALPINE}"|"${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" + CD_PKG_CA="ca-certificates" ;; esac cd_split - cd_echo "CD_CA_ROOT" "CD_CMD_CA" + cd_echo "CD_CA_ROOT" "CD_CMD_CA" "CD_PKG_CA" # common case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") @@ -132,7 +140,6 @@ cd_set_environment_variables () { CD_CMD_QUERY="rpm --query" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" - CD_PKG_CA="ca-certificates" CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_TEXT="\ @@ -152,7 +159,6 @@ skip_if_unavailable=False CD_CMD_QUERY="apk info" CD_CMD_UPDATE="apk update" CD_CMD_UPGRADE="apk upgrade" - CD_PKG_CA="ca-certificates-bundle" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" @@ -165,7 +171,6 @@ skip_if_unavailable=False CD_CMD_QUERY="pacman --query" CD_CMD_UPDATE="pacman --sync --refresh" CD_CMD_UPGRADE="pacman --sync --sysupgrade --noconfirm" - CD_PKG_CA="ca-certificates" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" @@ -178,7 +183,6 @@ skip_if_unavailable=False CD_CMD_QUERY="dpkg-query --show" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" - CD_PKG_CA="ca-certificates" CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" CD_PM_CONF_TEXT="\ From da2b2fa97a656ae86d667dfa54542e58c99b2ec2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 10 May 2024 23:26:31 +0200 Subject: [PATCH 211/392] cd_pm --- cd.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index a680ed3..ef93f21 100644 --- a/cd.sh +++ b/cd.sh @@ -135,6 +135,7 @@ cd_set_environment_variables () { # common case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") + CD_PM="${CD_PM_DNF}" CD_CMD_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_QUERY="rpm --query" @@ -154,6 +155,7 @@ skip_if_unavailable=False CD_PM_HTTPS_TEXT="sslverify=False" ;; "${CD_OS_ALPINE}") + CD_PM="${CD_PM_APK}" CD_CMD_CLEAN="apk cache purge" CD_CMD_INSTALL="apk add" CD_CMD_QUERY="apk info" @@ -166,6 +168,7 @@ skip_if_unavailable=False CD_PM_HTTPS_TEXT="--no-verify" ;; "${CD_OS_ARCH}") + CD_PM="${CD_PM_PACMAN}" CD_CMD_CLEAN="pacman --sync --clean --noconfirm" CD_CMD_INSTALL="pacman --sync --noconfirm" CD_CMD_QUERY="pacman --query" @@ -178,6 +181,7 @@ skip_if_unavailable=False CD_PM_HTTPS_TEXT="SSLVerify = No" ;; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_PM="${CD_PM_APT}" CD_CMD_CLEAN="apt-get clean" CD_CMD_INSTALL="apt-get install --assume-yes" CD_CMD_QUERY="dpkg-query --show" @@ -405,8 +409,7 @@ cd_list_working_directory () { } cd_set_https_verification_off () { - # TODO - if [ "${CD_CA}" -o "${CD_OS_ID}" = "${CD_OS_DEBIAN}" ] ; then + if [ "${CD_CA}" -o "${CD_PM}" = "${CD_PM_APT}" ] ; then cd_step "Set HTTPS verification off" cd_mkdir "$(dirname "${CD_PM_HTTPS_PATH}")" cd_write "${CD_PM_HTTPS_PATH}" "${CD_PM_HTTPS_TEXT}" @@ -669,5 +672,10 @@ CD_OS_FEDORA="fedora" CD_OS_ROCKY="rocky" CD_OS_UBUNTU="ubuntu" +CD_PM_APK="apk" +CD_PM_APT="apt" +CD_PM_DNF="dnf" +CD_PM_PACMAN="pacman" + # run cd_main From a125cf9a9936eb37de96f237466b4c8a4870c956 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 10 May 2024 23:57:02 +0200 Subject: [PATCH 212/392] =?UTF-8?q?=E2=88=92bundle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index ef93f21..3466b53 100644 --- a/cd.sh +++ b/cd.sh @@ -104,34 +104,31 @@ cd_set_environment_variables () { cd_echo "CD_OS_ID" "CD_OS_VERSION" # universal CD_DNS_FILE="/etc/resolv.conf" + CD_PKG_CA="ca-certificates" CD_PKG_GIT="git" cd_split - cd_echo "CD_DNS_FILE" "CD_PKG_GIT" + cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" # shared case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" CD_CMD_CA="update-ca-trust" - CD_PKG_CA="ca-certificates" ;; "${CD_OS_ALPINE}") CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" - CD_PKG_CA="ca-certificates-bundle" ;; "${CD_OS_ARCH}") CD_CA_ROOT="/etc/ca-certificates/trust-source/anchors" CD_CMD_CA="update-ca-trust" - CD_PKG_CA="ca-certificates" ;; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" - CD_PKG_CA="ca-certificates" ;; esac cd_split - cd_echo "CD_CA_ROOT" "CD_CMD_CA" "CD_PKG_CA" + cd_echo "CD_CA_ROOT" "CD_CMD_CA" # common case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") From a4520d7577acff9318d1de5d877c48c4909f0446 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 11 May 2024 12:23:40 +0200 Subject: [PATCH 213/392] =?UTF-8?q?=E2=88=92arch/2023?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index d161140..a659781 100644 --- a/readme.md +++ b/readme.md @@ -20,7 +20,7 @@ from various CA, CI, OCI / OS. * [X] 3.18 * [X] 3.19 * [X] Arch → Python 3.12 - * [X] 20231112 + * [ ] 20231112 * [X] 20240101 * [X] Debian * [X] Bullseye (11) → Python 3.9 @@ -51,17 +51,17 @@ from various CA, CI, OCI / OS. ## HTTPS & Python -| OS img | crt | upd | Python | -|:--------|-----|-----|:---------| -| Alma 8 | [X] | [X] | [ ] | -| Alma 9 | [X] | [X] | [X] 3.9 | -| Alpine | [X] | [ ] | [ ] | -| Arch | [X] | [X] | [ ] | -| Debian | [ ] | [ ] | [ ] | -| Fedora | [X] | [X] | [X] 3.12 | -| Rocky 8 | [X] | [X] | [ ] | -| Rocky 9 | [X] | [X] | [X] 3.9 | -| Ubuntu | [ ] | [ ] | [ ] | +| OS img | crt | upd | Python | +|:--------|-------|-------|:-----------| +| Alma 8 | * [X] | * [X] | * [ ] | +| Alma 9 | * [X] | * [X] | * [X] 3.9 | +| Alpine | * [X] | * [ ] | * [ ] | +| Arch | * [X] | * [X] | * [ ] | +| Debian | * [ ] | * [ ] | * [ ] | +| Fedora | * [X] | * [X] | * [X] 3.12 | +| Rocky 8 | * [X] | * [X] | * [ ] | +| Rocky 9 | * [X] | * [X] | * [X] 3.9 | +| Ubuntu | * [ ] | * [ ] | * [ ] | ## Tasks From 3b6803e2dac4749a98f18c105c243e66d9c8eff1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 11 May 2024 12:38:07 +0200 Subject: [PATCH 214/392] ballot --- readme.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/readme.md b/readme.md index a659781..556a91f 100644 --- a/readme.md +++ b/readme.md @@ -51,17 +51,17 @@ from various CA, CI, OCI / OS. ## HTTPS & Python -| OS img | crt | upd | Python | -|:--------|-------|-------|:-----------| -| Alma 8 | * [X] | * [X] | * [ ] | -| Alma 9 | * [X] | * [X] | * [X] 3.9 | -| Alpine | * [X] | * [ ] | * [ ] | -| Arch | * [X] | * [X] | * [ ] | -| Debian | * [ ] | * [ ] | * [ ] | -| Fedora | * [X] | * [X] | * [X] 3.12 | -| Rocky 8 | * [X] | * [X] | * [ ] | -| Rocky 9 | * [X] | * [X] | * [X] 3.9 | -| Ubuntu | * [ ] | * [ ] | * [ ] | +| OS img | crt | upd | Python | +|:--------|-----|-----|:-------| +| Alma 8 | ☑ | ☑ | ☐ | +| Alma 9 | ☑ | ☑ | ☑ 3.9 | +| Alpine | ☑ | ☐ | ☐ | +| Arch | ☑ | ☑ | ☐ | +| Debian | ☐ | ☐ | ☐ | +| Fedora | ☑ | ☑ | ☑ 3.12 | +| Rocky 8 | ☑ | ☑ | ☐ | +| Rocky 9 | ☑ | ☑ | ☑ 3.9 | +| Ubuntu | ☐ | ☐ | ☐ | ## Tasks From fb8ff9af61290e15b980ba732fa5364d65edfab5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 15:20:25 +0200 Subject: [PATCH 215/392] comments --- cd.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 3466b53..f1b7806 100644 --- a/cd.sh +++ b/cd.sh @@ -38,7 +38,7 @@ cd_main () { cd_set_environment_variables () { cd_step "Set environment variables" - # operating system + # set operating system id CD_OS_ID="$(cd_grep_os ID)" case "${CD_OS_ID}" in "almalinux") CD_OS_ID="${CD_OS_ALMA}" ;; @@ -50,6 +50,7 @@ cd_set_environment_variables () { "ubuntu") CD_OS_ID="${CD_OS_UBUNTU}" ;; *) cd_error_os "CD_OS_ID" ;; esac + # set operating system version case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ARCH}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_OS_VERSION=$(cd_grep_os VERSION_ID \ @@ -63,6 +64,7 @@ cd_set_environment_variables () { CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" ;; esac + # check operating system version case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") case "${CD_OS_VERSION}" in @@ -108,7 +110,7 @@ cd_set_environment_variables () { CD_PKG_GIT="git" cd_split cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" - # shared + # set ca command & root case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_CA_ROOT="/etc/pki/ca-trust/source/anchors" @@ -129,7 +131,7 @@ cd_set_environment_variables () { esac cd_split cd_echo "CD_CA_ROOT" "CD_CMD_CA" - # common + # set package manager case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_PM="${CD_PM_DNF}" @@ -253,7 +255,7 @@ Dir::Etc::SourceParts \"\"; esac cd_split cd_echo "CD_URL_DEFAULT" "CD_URL_CHOSEN" - # python + # set python command & package case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_ROCKY}") CD_PYTHON_COMMAND="python3.11" @@ -286,6 +288,7 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGE="python3" ;; esac + # set python packages case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_PYTHON_PACKAGES="/usr/lib64/${CD_PYTHON_COMMAND}/site-packages" From 117d073138d91542ad6b732c1b183305a990f59a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 15:22:38 +0200 Subject: [PATCH 216/392] cd_step any --- cd.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index f1b7806..6a9b219 100644 --- a/cd.sh +++ b/cd.sh @@ -638,14 +638,12 @@ cd_split () { } cd_step () { - if [ "${1}" ] ; then - CD_STEP=$((CD_STEP+1)) - echo -n "\ + CD_STEP=$((CD_STEP+1)) + echo -n "\ ╭─╌╌┄┄┈┈ -│ ${CD_STEP} ${1} +│ ${CD_STEP} ${@} ╰─╌╌┄┄┈┈ " - fi } cd_write () { From 1f8d5b0a8652ac60e06d0acc17d60551f7b42673 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 15:32:15 +0200 Subject: [PATCH 217/392] cd_split constant --- cd.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 6a9b219..fff9929 100644 --- a/cd.sh +++ b/cd.sh @@ -633,16 +633,16 @@ local file cd_split () { echo -n "\ -╶─╌╌┄┄┈┈ +╶${CD_SPLIT} " } cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ -╭─╌╌┄┄┈┈ +╭${CD_SPLIT} │ ${CD_STEP} ${@} -╰─╌╌┄┄┈┈ +╰${CD_SPLIT} " } @@ -675,5 +675,7 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" +CD_SPLIT="─╌╌┄┄┈┈" + # run cd_main From ae496a66afd692d166edcf239b5fdc2e3ed9a952 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 15:47:50 +0200 Subject: [PATCH 218/392] cd_sed --- cd.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index fff9929..e8da6a4 100644 --- a/cd.sh +++ b/cd.sh @@ -620,14 +620,15 @@ cd_rm () { cd_sed () { local expression -local file - if [ -f "${1}" ] ; then - file="${1}" - shift - for expression in "${@}" ; do - sed --in-place "s${expression}g" "${file}" || exit - done +local file="${1}" +shift + if [ -f "${file}" ] ; then cd_cat "${file}" + for expression in "${@}" ; do + sed --in-place "s${expression}g" "${file}" \ + && cd_cat "${file}" \ + || exit + done fi } From 9838ed3a6c3bb307e2ada30eba8d2082966240c5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 15:49:30 +0200 Subject: [PATCH 219/392] cd_rm --- cd.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index e8da6a4..e2b9b3b 100644 --- a/cd.sh +++ b/cd.sh @@ -612,9 +612,10 @@ local file="${1}" } cd_rm () { - if [ -e "${1}" ] ; then - echo "← ${1}" - rm -r "${1}" || exit +local path="${1}" + if [ -e "${path}" ] ; then + echo "← ${path}" + rm -r "${path}" || exit fi } From 86902bea36972e5068adc4a52410394e3fde3f9c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 15:58:11 +0200 Subject: [PATCH 220/392] cd_openssl test --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index e2b9b3b..2a5fe85 100644 --- a/cd.sh +++ b/cd.sh @@ -606,7 +606,7 @@ cd_mkdir () { cd_openssl () { local file="${1}" - if [ "${file}" ] ; then + if [ -f "${file}" ] ; then openssl x509 -noout -text -in "${file}" || exit fi } From 64c65167bacf2ba9b1891ea8ac141189918b5a06 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 16:04:04 +0200 Subject: [PATCH 221/392] cd_python_alias --- cd.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 2a5fe85..ee3241f 100644 --- a/cd.sh +++ b/cd.sh @@ -108,8 +108,9 @@ cd_set_environment_variables () { CD_DNS_FILE="/etc/resolv.conf" CD_PKG_CA="ca-certificates" CD_PKG_GIT="git" + CD_PYTHON_ALIAS="python3" cd_split - cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" + cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" "CD_PYTHON_ALIAS" # set ca command & root case "${CD_OS_ID}" in "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") @@ -297,7 +298,7 @@ Dir::Etc::SourceParts \"\"; CD_PYTHON_PACKAGES="/usr/lib/${CD_PYTHON_COMMAND}/site-packages" ;; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") - CD_PYTHON_PACKAGES="/usr/lib/python3/dist-packages" + CD_PYTHON_PACKAGES="/usr/lib/${CD_PYTHON_ALIAS}/dist-packages" ;; esac cd_split @@ -535,7 +536,7 @@ ${self} ↓ ${1} " - "${CD_PYTHON_COMMAND}" -m "${1}" "${CD_STEP}" "${self}" + "${CD_PYTHON_ALIAS}" -m "${1}" "${CD_STEP}" "${self}" } # functions @@ -584,9 +585,10 @@ cd_install_package () { } cd_ln_python () { - if [ "${1}" ] ; then - echo "python3 → ${1}" - ln -f -s "${1}" "/usr/bin/python3" || exit +local command="${1}" + if [ "${command}" ] ; then + echo "${CD_PYTHON_ALIAS} → ${command}" + ln -f -s "${command}" "/usr/bin/${CD_PYTHON_ALIAS}" || exit fi } From 794165c012bbf6d012afef626104247cfdba4fd0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 16:40:03 +0200 Subject: [PATCH 222/392] cd_pm --- cd.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index ee3241f..7dd8860 100644 --- a/cd.sh +++ b/cd.sh @@ -134,8 +134,23 @@ cd_set_environment_variables () { cd_echo "CD_CA_ROOT" "CD_CMD_CA" # set package manager case "${CD_OS_ID}" in + "${CD_OS_ALPINE}") + CD_PM="${CD_PM_APK}" + ;; + "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") + CD_PM="${CD_PM_APT}" + ;; "${CD_OS_ALMA}"|"${CD_OS_FEDORA}"|"${CD_OS_ROCKY}") CD_PM="${CD_PM_DNF}" + ;; + "${CD_OS_ARCH}") + CD_PM="${CD_PM_PACMAN}" + ;; + esac + cd_split + cd_echo "CD_PM" + case "${CD_PM}" in + "${CD_PM_DNF}") CD_CMD_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_QUERY="rpm --query" @@ -154,8 +169,7 @@ skip_if_unavailable=False CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" CD_PM_HTTPS_TEXT="sslverify=False" ;; - "${CD_OS_ALPINE}") - CD_PM="${CD_PM_APK}" + "${CD_PM_APK}") CD_CMD_CLEAN="apk cache purge" CD_CMD_INSTALL="apk add" CD_CMD_QUERY="apk info" @@ -167,8 +181,7 @@ skip_if_unavailable=False CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" CD_PM_HTTPS_TEXT="--no-verify" ;; - "${CD_OS_ARCH}") - CD_PM="${CD_PM_PACMAN}" + "${CD_PM_PACMAN}") CD_CMD_CLEAN="pacman --sync --clean --noconfirm" CD_CMD_INSTALL="pacman --sync --noconfirm" CD_CMD_QUERY="pacman --query" @@ -180,8 +193,7 @@ skip_if_unavailable=False CD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" CD_PM_HTTPS_TEXT="SSLVerify = No" ;; - "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") - CD_PM="${CD_PM_APT}" + "${CD_PM_APT}") CD_CMD_CLEAN="apt-get clean" CD_CMD_INSTALL="apt-get install --assume-yes" CD_CMD_QUERY="dpkg-query --show" From 27f632eb673709b9abb6d77325f5e10318c64a84 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 20:18:22 +0200 Subject: [PATCH 223/392] pm/clean --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 7dd8860..fb6f473 100644 --- a/cd.sh +++ b/cd.sh @@ -151,7 +151,7 @@ cd_set_environment_variables () { cd_echo "CD_PM" case "${CD_PM}" in "${CD_PM_DNF}") - CD_CMD_CLEAN="dnf clean all" + CD_PM_CLEAN="dnf clean all" CD_CMD_INSTALL="dnf install --assumeyes" CD_CMD_QUERY="rpm --query" CD_CMD_UPDATE="dnf makecache" @@ -170,7 +170,7 @@ skip_if_unavailable=False CD_PM_HTTPS_TEXT="sslverify=False" ;; "${CD_PM_APK}") - CD_CMD_CLEAN="apk cache purge" + CD_PM_CLEAN="apk cache purge" CD_CMD_INSTALL="apk add" CD_CMD_QUERY="apk info" CD_CMD_UPDATE="apk update" @@ -182,7 +182,7 @@ skip_if_unavailable=False CD_PM_HTTPS_TEXT="--no-verify" ;; "${CD_PM_PACMAN}") - CD_CMD_CLEAN="pacman --sync --clean --noconfirm" + CD_PM_CLEAN="pacman --sync --clean --noconfirm" CD_CMD_INSTALL="pacman --sync --noconfirm" CD_CMD_QUERY="pacman --query" CD_CMD_UPDATE="pacman --sync --refresh" @@ -194,7 +194,7 @@ skip_if_unavailable=False CD_PM_HTTPS_TEXT="SSLVerify = No" ;; "${CD_PM_APT}") - CD_CMD_CLEAN="apt-get clean" + CD_PM_CLEAN="apt-get clean" CD_CMD_INSTALL="apt-get install --assume-yes" CD_CMD_QUERY="dpkg-query --show" CD_CMD_UPDATE="apt-get update" @@ -213,7 +213,7 @@ Dir::Etc::SourceParts \"\"; ;; esac cd_split - cd_echo "CD_CMD_CLEAN" \ + cd_echo "CD_PM_CLEAN" \ "CD_CMD_INSTALL" "CD_CMD_QUERY" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PKG_PKG" "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" @@ -504,7 +504,7 @@ cd_install_python () { cd_clean_packages_cache () { cd_step "Clean packages cache" - ${CD_CMD_CLEAN} || exit + ${CD_PM_CLEAN} || exit } cd_install_python_modules () { From e13ffce6918eaa70d5be97d6d7497119454cd2c1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 20:19:11 +0200 Subject: [PATCH 224/392] pm/install --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index fb6f473..13b0766 100644 --- a/cd.sh +++ b/cd.sh @@ -152,7 +152,7 @@ cd_set_environment_variables () { case "${CD_PM}" in "${CD_PM_DNF}") CD_PM_CLEAN="dnf clean all" - CD_CMD_INSTALL="dnf install --assumeyes" + CD_PM_INSTALL="dnf install --assumeyes" CD_CMD_QUERY="rpm --query" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" @@ -171,7 +171,7 @@ skip_if_unavailable=False ;; "${CD_PM_APK}") CD_PM_CLEAN="apk cache purge" - CD_CMD_INSTALL="apk add" + CD_PM_INSTALL="apk add" CD_CMD_QUERY="apk info" CD_CMD_UPDATE="apk update" CD_CMD_UPGRADE="apk upgrade" @@ -183,7 +183,7 @@ skip_if_unavailable=False ;; "${CD_PM_PACMAN}") CD_PM_CLEAN="pacman --sync --clean --noconfirm" - CD_CMD_INSTALL="pacman --sync --noconfirm" + CD_PM_INSTALL="pacman --sync --noconfirm" CD_CMD_QUERY="pacman --query" CD_CMD_UPDATE="pacman --sync --refresh" CD_CMD_UPGRADE="pacman --sync --sysupgrade --noconfirm" @@ -195,7 +195,7 @@ skip_if_unavailable=False ;; "${CD_PM_APT}") CD_PM_CLEAN="apt-get clean" - CD_CMD_INSTALL="apt-get install --assume-yes" + CD_PM_INSTALL="apt-get install --assume-yes" CD_CMD_QUERY="dpkg-query --show" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" @@ -214,7 +214,7 @@ Dir::Etc::SourceParts \"\"; esac cd_split cd_echo "CD_PM_CLEAN" \ - "CD_CMD_INSTALL" "CD_CMD_QUERY" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" + "CD_PM_INSTALL" "CD_CMD_QUERY" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PKG_PKG" "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific @@ -592,7 +592,7 @@ local variable="${1}" cd_install_package () { if [ "${1}" ] ; then - ${CD_CMD_INSTALL} "${1}" || exit + ${CD_PM_INSTALL} "${1}" || exit fi } From ae2be1102503c7bebc481450fdf52144c88f898f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 20:20:40 +0200 Subject: [PATCH 225/392] pm/query --- cd.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index 13b0766..fa3bb4f 100644 --- a/cd.sh +++ b/cd.sh @@ -153,7 +153,7 @@ cd_set_environment_variables () { "${CD_PM_DNF}") CD_PM_CLEAN="dnf clean all" CD_PM_INSTALL="dnf install --assumeyes" - CD_CMD_QUERY="rpm --query" + CD_PM_QUERY="rpm --query" CD_CMD_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" @@ -172,7 +172,7 @@ skip_if_unavailable=False "${CD_PM_APK}") CD_PM_CLEAN="apk cache purge" CD_PM_INSTALL="apk add" - CD_CMD_QUERY="apk info" + CD_PM_QUERY="apk info" CD_CMD_UPDATE="apk update" CD_CMD_UPGRADE="apk upgrade" CD_PKG_PKG="" @@ -184,7 +184,7 @@ skip_if_unavailable=False "${CD_PM_PACMAN}") CD_PM_CLEAN="pacman --sync --clean --noconfirm" CD_PM_INSTALL="pacman --sync --noconfirm" - CD_CMD_QUERY="pacman --query" + CD_PM_QUERY="pacman --query" CD_CMD_UPDATE="pacman --sync --refresh" CD_CMD_UPGRADE="pacman --sync --sysupgrade --noconfirm" CD_PKG_PKG="" @@ -196,7 +196,7 @@ skip_if_unavailable=False "${CD_PM_APT}") CD_PM_CLEAN="apt-get clean" CD_PM_INSTALL="apt-get install --assume-yes" - CD_CMD_QUERY="dpkg-query --show" + CD_PM_QUERY="dpkg-query --show" CD_CMD_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" @@ -214,7 +214,7 @@ Dir::Etc::SourceParts \"\"; esac cd_split cd_echo "CD_PM_CLEAN" \ - "CD_PM_INSTALL" "CD_CMD_QUERY" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" + "CD_PM_INSTALL" "CD_PM_QUERY" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PKG_PKG" "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific From 3435269d236327743d1ee58013c14b5753e1bcec Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 20:21:31 +0200 Subject: [PATCH 226/392] pm/update --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index fa3bb4f..4bbfb69 100644 --- a/cd.sh +++ b/cd.sh @@ -154,7 +154,7 @@ cd_set_environment_variables () { CD_PM_CLEAN="dnf clean all" CD_PM_INSTALL="dnf install --assumeyes" CD_PM_QUERY="rpm --query" - CD_CMD_UPDATE="dnf makecache" + CD_PM_UPDATE="dnf makecache" CD_CMD_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" @@ -173,7 +173,7 @@ skip_if_unavailable=False CD_PM_CLEAN="apk cache purge" CD_PM_INSTALL="apk add" CD_PM_QUERY="apk info" - CD_CMD_UPDATE="apk update" + CD_PM_UPDATE="apk update" CD_CMD_UPGRADE="apk upgrade" CD_PKG_PKG="" CD_PM_CONF_PATH="" @@ -185,7 +185,7 @@ skip_if_unavailable=False CD_PM_CLEAN="pacman --sync --clean --noconfirm" CD_PM_INSTALL="pacman --sync --noconfirm" CD_PM_QUERY="pacman --query" - CD_CMD_UPDATE="pacman --sync --refresh" + CD_PM_UPDATE="pacman --sync --refresh" CD_CMD_UPGRADE="pacman --sync --sysupgrade --noconfirm" CD_PKG_PKG="" CD_PM_CONF_PATH="" @@ -197,7 +197,7 @@ skip_if_unavailable=False CD_PM_CLEAN="apt-get clean" CD_PM_INSTALL="apt-get install --assume-yes" CD_PM_QUERY="dpkg-query --show" - CD_CMD_UPDATE="apt-get update" + CD_PM_UPDATE="apt-get update" CD_CMD_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" @@ -214,7 +214,7 @@ Dir::Etc::SourceParts \"\"; esac cd_split cd_echo "CD_PM_CLEAN" \ - "CD_PM_INSTALL" "CD_PM_QUERY" "CD_CMD_UPDATE" "CD_CMD_UPGRADE" + "CD_PM_INSTALL" "CD_PM_QUERY" "CD_PM_UPDATE" "CD_CMD_UPGRADE" cd_split cd_echo "CD_PKG_PKG" "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific @@ -444,7 +444,7 @@ local text="" cd_update_packages_catalog () { cd_step "Update packages catalog" - ${CD_CMD_UPDATE} || exit + ${CD_PM_UPDATE} || exit } cd_install_packages_tools () { From 80582ddf37ea88041785f98c4a0a80aaba8ddaba Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 23 May 2024 20:22:21 +0200 Subject: [PATCH 227/392] pm/upgrade --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 4bbfb69..f4c9886 100644 --- a/cd.sh +++ b/cd.sh @@ -155,7 +155,7 @@ cd_set_environment_variables () { CD_PM_INSTALL="dnf install --assumeyes" CD_PM_QUERY="rpm --query" CD_PM_UPDATE="dnf makecache" - CD_CMD_UPGRADE="dnf upgrade --assumeyes" + CD_PM_UPGRADE="dnf upgrade --assumeyes" CD_PKG_PKG="" CD_PM_CONF_PATH="/etc/dnf/dnf.conf" CD_PM_CONF_TEXT="\ @@ -174,7 +174,7 @@ skip_if_unavailable=False CD_PM_INSTALL="apk add" CD_PM_QUERY="apk info" CD_PM_UPDATE="apk update" - CD_CMD_UPGRADE="apk upgrade" + CD_PM_UPGRADE="apk upgrade" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" @@ -186,7 +186,7 @@ skip_if_unavailable=False CD_PM_INSTALL="pacman --sync --noconfirm" CD_PM_QUERY="pacman --query" CD_PM_UPDATE="pacman --sync --refresh" - CD_CMD_UPGRADE="pacman --sync --sysupgrade --noconfirm" + CD_PM_UPGRADE="pacman --sync --sysupgrade --noconfirm" CD_PKG_PKG="" CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" @@ -198,7 +198,7 @@ skip_if_unavailable=False CD_PM_INSTALL="apt-get install --assume-yes" CD_PM_QUERY="dpkg-query --show" CD_PM_UPDATE="apt-get update" - CD_CMD_UPGRADE="apt-get upgrade --assume-yes" + CD_PM_UPGRADE="apt-get upgrade --assume-yes" CD_PKG_PKG="apt-utils" CD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf" CD_PM_CONF_TEXT="\ @@ -214,7 +214,7 @@ Dir::Etc::SourceParts \"\"; esac cd_split cd_echo "CD_PM_CLEAN" \ - "CD_PM_INSTALL" "CD_PM_QUERY" "CD_PM_UPDATE" "CD_CMD_UPGRADE" + "CD_PM_INSTALL" "CD_PM_QUERY" "CD_PM_UPDATE" "CD_PM_UPGRADE" cd_split cd_echo "CD_PKG_PKG" "CD_PM_CONF_PATH" "CD_PM_HTTPS_PATH" # specific @@ -487,7 +487,7 @@ cd_set_https_verification_on () { cd_upgrade_packages () { cd_step "Upgrade packages" - ${CD_CMD_UPGRADE} || exit + ${CD_PM_UPGRADE} || exit } cd_install_git () { From e191f3cc4ddaf3e24ec8a6ceb2993f6f532d2f3d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 00:21:42 +0200 Subject: [PATCH 228/392] browse-workspace --- cd/__init__.py | 16 ++++++++++++++++ cd/project.py | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/cd/__init__.py b/cd/__init__.py index 5fc2a66..83dac8f 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -10,6 +10,21 @@ projects = Projects(os.environ) project = Project(projects) +def cd_browse_workspace(): + print(f'''\ +{project.root} +↓ +''', end=str()) + files = [] + for directory, directories, files in os.walk(project.root): + for file in files: + absolute_path = os.path.join(directory, file) + relative_path = os.path.relpath(absolute_path, start=project.root) + files.append(relative_path) + for file in files: + print(file) + + def cd_clone_branch(): print(f'''\ {project.url} @@ -32,6 +47,7 @@ def cd_list_environment(): def install_commands(path): user = '/usr/local/bin' for command in [ + 'browse-workspace', 'clone-branch', 'list-environment', ]: diff --git a/cd/project.py b/cd/project.py index b5740e2..d5a96d7 100644 --- a/cd/project.py +++ b/cd/project.py @@ -8,6 +8,10 @@ NAME = [ 'GITHUB_REPOSITORY', 'CI_PROJECT_PATH', ] +ROOT = [ + 'GITHUB_WORKSPACE', + 'CI_PROJECT_DIR', +] class Project: @@ -21,5 +25,9 @@ class Project: for variable in NAME: if value := projects.environment.get(variable, None): self.name = path.basename(value) + # root + for variable in ROOT: + if value := projects.environment.get(variable, None): + self.root = value # url self.url = path.join(projects.url, self.name) From 60dc1a34958f4f7fede9f0d42695cb8aa3025151 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 00:46:05 +0200 Subject: [PATCH 229/392] paths --- cd/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 83dac8f..e045397 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -15,14 +15,14 @@ def cd_browse_workspace(): {project.root} ↓ ''', end=str()) - files = [] + paths = [] for directory, directories, files in os.walk(project.root): for file in files: absolute_path = os.path.join(directory, file) relative_path = os.path.relpath(absolute_path, start=project.root) - files.append(relative_path) - for file in files: - print(file) + paths.append(relative_path) + for path in paths: + print(path) def cd_clone_branch(): From 40e80c90b0e141afb4518449f37d6df8d2d242af Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 00:49:23 +0200 Subject: [PATCH 230/392] sorted --- cd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index e045397..cb95ebf 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -21,7 +21,7 @@ def cd_browse_workspace(): absolute_path = os.path.join(directory, file) relative_path = os.path.relpath(absolute_path, start=project.root) paths.append(relative_path) - for path in paths: + for path in sorted(paths): print(path) From 50247d02dd493dc077d2b4e8c819f07b1063fccc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 12:00:26 +0200 Subject: [PATCH 231/392] =?UTF-8?q?=E2=88=92.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/cd-browse-workspace.sh | 1 - 1 file changed, 1 deletion(-) delete mode 100755 cmd/cd-browse-workspace.sh diff --git a/cmd/cd-browse-workspace.sh b/cmd/cd-browse-workspace.sh deleted file mode 100755 index b99d6d2..0000000 --- a/cmd/cd-browse-workspace.sh +++ /dev/null @@ -1 +0,0 @@ -tree -a "${GITHUB_WORKSPACE}" From 380684eed988447de1150da838625fcfa40e00ee Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 12:03:15 +0200 Subject: [PATCH 232/392] cd-clone-branch --- cd/__init__.py | 2 +- cmd/cd-clone-branch.sh | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100755 cmd/cd-clone-branch.sh diff --git a/cd/__init__.py b/cd/__init__.py index cb95ebf..c161dd6 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -35,7 +35,7 @@ def cd_clone_branch(): '--branch', project.branch, '--', project.url, - os.path.realpath(os.curdir), + project.root, ) diff --git a/cmd/cd-clone-branch.sh b/cmd/cd-clone-branch.sh deleted file mode 100755 index e84ff7b..0000000 --- a/cmd/cd-clone-branch.sh +++ /dev/null @@ -1,8 +0,0 @@ -git clone \ ---branch "${GITHUB_REF_NAME}" \ --- \ -"${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \ -'.' - -rm --force --recursive \ -'.git' '.gitignore' From 5a2cf6253bbf62c35f4e7a41f54b2d5f45bf100d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 12:35:05 +0200 Subject: [PATCH 233/392] build-project --- cd/__init__.py | 11 +++++++++++ cmd/cd-build-project.sh | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) delete mode 100755 cmd/cd-build-project.sh diff --git a/cd/__init__.py b/cd/__init__.py index c161dd6..8f2bf6e 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -25,6 +25,16 @@ def cd_browse_workspace(): print(path) +def cd_build_project(): + for extension in ['py', 'sh']: + path = os.path.join(project.root, f'build.{extension}') + if os.path.exists(path): + ps.run(path) + break + else: + pass + + def cd_clone_branch(): print(f'''\ {project.url} @@ -48,6 +58,7 @@ def install_commands(path): user = '/usr/local/bin' for command in [ 'browse-workspace', + 'build-project', 'clone-branch', 'list-environment', ]: diff --git a/cmd/cd-build-project.sh b/cmd/cd-build-project.sh deleted file mode 100755 index 460566e..0000000 --- a/cmd/cd-build-project.sh +++ /dev/null @@ -1,9 +0,0 @@ -if [ -x './build.py' ] ; then - ./build.py \ - || exit -elif [ -x './build.sh' ] ; then - ./build.sh \ - || exit -else - exit -fi From 3f0a4f815c832b79c56908745387e342c654b8df Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 18:18:26 +0200 Subject: [PATCH 234/392] cd-clone-branch --- .forgejo/workflows/almalinux:8.yaml | 1 + .forgejo/workflows/almalinux:9.yaml | 1 + .forgejo/workflows/alpine:3.18.yaml | 1 + .forgejo/workflows/alpine:3.19.yaml | 1 + .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 1 + .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 1 + .forgejo/workflows/debian:bullseye.yaml | 1 + .forgejo/workflows/fedora:39.yaml | 1 + .forgejo/workflows/fedora:40.yaml | 1 + .forgejo/workflows/rockylinux:8.yaml | 1 + .forgejo/workflows/rockylinux:9.yaml | 1 + .forgejo/workflows/ubuntu:jammy.yaml | 1 + .forgejo/workflows/ubuntu:noble.yaml | 1 + .gitlab-ci.yml | 1 - 14 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 34df8b8..830163f 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index d510837..9acc6ff 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index ecf81ce..ee2fe16 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index be34e54..56822d2 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index c672ea1..e7bf484 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index bac2557..ad820f2 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index 82cf822..d36bf30 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 0f0a195..8436465 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index beb2f0d..3ec95f5 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index 14b52d2..df19a7f 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index a29242e..d000dd1 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index ac3ce6d..23b9e42 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index e620719..7513578 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -10,4 +10,5 @@ jobs: run: eval ${{vars.cd}} - run: cd-list-environment + - run: cd-clone-branch - run: cd-browse-workspace diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3de640e..c786575 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ image: debian:bookworm job: script: - - pwd && ls -a -l - source ${CD} - cd-list-environment From 9032b80dcf87c07dbab09f8d668b71517a239ba6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 18:24:18 +0200 Subject: [PATCH 235/392] cd-build-project --- .forgejo/workflows/almalinux:8.yaml | 1 + .forgejo/workflows/almalinux:9.yaml | 1 + .forgejo/workflows/alpine:3.18.yaml | 1 + .forgejo/workflows/alpine:3.19.yaml | 1 + .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 1 + .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 1 + .forgejo/workflows/debian:bookworm.yaml | 3 +-- .forgejo/workflows/debian:bullseye.yaml | 1 + .forgejo/workflows/fedora:39.yaml | 1 + .forgejo/workflows/fedora:40.yaml | 1 + .forgejo/workflows/rockylinux:8.yaml | 1 + .forgejo/workflows/rockylinux:9.yaml | 1 + .forgejo/workflows/ubuntu:jammy.yaml | 1 + .forgejo/workflows/ubuntu:noble.yaml | 1 + .gitlab-ci.yml | 2 +- 15 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 830163f..4931810 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index 9acc6ff..596e81f 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index ee2fe16..9082776 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index 56822d2..169119c 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index e7bf484..2fb6805 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index ad820f2..3442cfd 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 7ac4390..976d9ae 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -4,7 +4,6 @@ jobs: container: image: debian:bookworm steps: - - run: pwd && ls -a -l - name: cd env: CD: ${{secrets.cd}} @@ -12,6 +11,6 @@ jobs: - run: cd-list-environment - run: cd-clone-branch - - run: cd-browse-workspace - run: cd-build-project + - run: cd-browse-workspace - run: cd-synchronize out diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index d36bf30..6a61463 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 8436465..7a21790 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index 3ec95f5..04568ed 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index df19a7f..7c002a9 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index d000dd1..66e97ae 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index 23b9e42..c7b6cb4 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index 7513578..5f487ad 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -11,4 +11,5 @@ jobs: - run: cd-list-environment - run: cd-clone-branch + - run: cd-build-project - run: cd-browse-workspace diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c786575..b6461ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,6 @@ job: - cd-list-environment - cd-clone-branch - - cd-browse-workspace - cd-build-project + - cd-browse-workspace - cd-synchronize out From b103d6967c6e97eb4ac341b4aea97628f0d52bf5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 18:53:34 +0200 Subject: [PATCH 236/392] =?UTF-8?q?=E2=88=92sync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b6461ec..8158f14 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,4 +7,3 @@ job: - cd-clone-branch - cd-build-project - cd-browse-workspace - - cd-synchronize out From b3ae76109ef101a856bbd477edb3d2e6c02cc97b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 20:38:32 +0200 Subject: [PATCH 237/392] rsync --- cd.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cd.sh b/cd.sh index f4c9886..25a6488 100644 --- a/cd.sh +++ b/cd.sh @@ -29,6 +29,8 @@ cd_main () { cd_upgrade_packages cd_install_git cd_install_python + # TODO move to Python + cd_install_rsync cd_clean_packages_cache cd_install_python_modules ${CD_PYTHON_MODULES} cd_execute_python_module ${CD_PYTHON_MODULES} @@ -108,6 +110,8 @@ cd_set_environment_variables () { CD_DNS_FILE="/etc/resolv.conf" CD_PKG_CA="ca-certificates" CD_PKG_GIT="git" + # TODO move to Python + CD_PKG_RSYNC="rsync" CD_PYTHON_ALIAS="python3" cd_split cd_echo "CD_DNS_FILE" "CD_PKG_CA" "CD_PKG_GIT" "CD_PYTHON_ALIAS" @@ -502,6 +506,12 @@ cd_install_python () { cd_ln_python "${CD_PYTHON_COMMAND}" } +# TODO move to Python +cd_install_rsync () { + cd_step "Install Rsync" + cd_install_package "${CD_PKG_RSYNC}" +} + cd_clean_packages_cache () { cd_step "Clean packages cache" ${CD_PM_CLEAN} || exit From aaa73f75c85bed9f467ae1a47f8db44f33b76e18 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 21:29:06 +0200 Subject: [PATCH 238/392] ssh --- bootstrap.sh | 9 --------- cd.sh | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index e6a0466..2e038fd 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -7,11 +7,6 @@ KEY_ALGORITHM='ed25519' KEY_DIRECTORY='.ssh' KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}" KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5' -PACKAGES=( -'openssh-client' -'rsync' -'tree' -) SERVER="$(basename ${GITHUB_SERVER_URL})" TARGET='/usr/local/sbin' @@ -36,7 +31,3 @@ chmod '400' "${KEY_PATH}" \ echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \ > "${KEY_DIRECTORY}/known_hosts" \ || exit - -# packages -apt-get install --yes "${PACKAGES[@]}" \ -|| exit diff --git a/cd.sh b/cd.sh index 25a6488..9c9639c 100644 --- a/cd.sh +++ b/cd.sh @@ -31,6 +31,8 @@ cd_main () { cd_install_python # TODO move to Python cd_install_rsync + # TODO move to Python + cd_install_ssh cd_clean_packages_cache cd_install_python_modules ${CD_PYTHON_MODULES} cd_execute_python_module ${CD_PYTHON_MODULES} @@ -353,6 +355,13 @@ Dir::Etc::SourceParts \"\"; "CD_PROJECTS_GROUP" "CD_PROJECT_NAME" "CD_PROJECT_BRANCH" cd_split cd_echo "CD_PROJECTS_URL" "CD_PROJECT_URL" + # TODO move to Python + case "${CD_PM}" in + "${CD_PM_APK}"|"${CD_PM_APT}") CD_PKG_SSH="openssh-client" ;; + "${CD_PM_DNF}") CD_PKG_SSH="openssh-clients" ;; + "${CD_PM_PACMAN}") CD_PKG_SSH="openssh" ;; + ;; + esac } cd_set_packages_repositories () { @@ -512,6 +521,12 @@ cd_install_rsync () { cd_install_package "${CD_PKG_RSYNC}" } +# TODO move to Python +cd_install_ssh () { + cd_step "Install SSH" + cd_install_package "${CD_PKG_SSH}" +} + cd_clean_packages_cache () { cd_step "Clean packages cache" ${CD_PM_CLEAN} || exit From 887ef88ba9946e5a54849c0212637289005a3a5b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 30 May 2024 21:31:29 +0200 Subject: [PATCH 239/392] =?UTF-8?q?=E2=88=92commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bootstrap.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 2e038fd..598653d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,22 +1,10 @@ #! /usr/bin/env bash -FILE="$(realpath "${BASH_SOURCE[0]}")" -ROOT="$(dirname "${FILE}")" -COMMANDS='cmd' KEY_ALGORITHM='ed25519' KEY_DIRECTORY='.ssh' KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}" KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5' SERVER="$(basename ${GITHUB_SERVER_URL})" -TARGET='/usr/local/sbin' - -# commands -cd "${ROOT}/${COMMANDS}" \ -|| exit -for file in *.sh ; do - cp "${file}" "${TARGET}/${file%.sh}" \ - || exit -done # ssh cd \ From 70a8fd3e93efa392a9d1753e2355070ec7c2868d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 31 May 2024 00:29:12 +0200 Subject: [PATCH 240/392] ssh/wip --- bootstrap.sh | 21 --------------------- cd/__init__.py | 25 ++++++++++++++++++++++++- cd/__main__.py | 1 + readme.md | 2 ++ 4 files changed, 27 insertions(+), 22 deletions(-) delete mode 100755 bootstrap.sh diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 598653d..0000000 --- a/bootstrap.sh +++ /dev/null @@ -1,21 +0,0 @@ -#! /usr/bin/env bash - -KEY_ALGORITHM='ed25519' -KEY_DIRECTORY='.ssh' -KEY_PATH="${KEY_DIRECTORY}/id_${KEY_ALGORITHM}" -KEY_PUBLIC='AAAAC3NzaC1lZDI1NTE5AAAAIPHCNcgHlQoiNTXfnUZYvHz9OZwYsmBCrSSV7a7Zche5' -SERVER="$(basename ${GITHUB_SERVER_URL})" - -# ssh -cd \ -|| exit -mkdir "${KEY_DIRECTORY}" \ -|| exit -echo "${CD}" > "${KEY_PATH}" \ -|| exit -unset CD -chmod '400' "${KEY_PATH}" \ -|| exit -echo "${SERVER} ssh-${KEY_ALGORITHM} ${KEY_PUBLIC}" \ -> "${KEY_DIRECTORY}/known_hosts" \ -|| exit diff --git a/cd/__init__.py b/cd/__init__.py index 8f2bf6e..ac39077 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -2,6 +2,7 @@ import os from cd.project import Project from cd.projects import Projects +from rwx import fs from rwx import ps COMMANDS_PREFIX = 'cd-' @@ -50,7 +51,7 @@ def cd_clone_branch(): def cd_list_environment(): - for variable, value in sorted(os.environ.items()): + for variable, value in sorted(projects.environment.items()): print(variable, '=', value) @@ -64,3 +65,25 @@ def install_commands(path): ]: print(command) os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}')) + + +def set_ssh(): + ssh_hosts = projects.environment.get('CD_SSH_HOSTS', None) + ssh_key = projects.environment.get('CD', None) + ssh_type = projects.environment.get('CD_SSH_TYPE', 'ed25519') + # + home = os.path.expanduser('~') + # + ssh = os.path.join(home, '.ssh') + os.makedirs(ssh, exist_ok=True) + os.chmod(ssh, 0o700) + # + key = os.path.join(ssh, f'id_{ssh_type}') + if ssh_key: + fs.write(key, ssh_key) + os.chmod(key, 0o400) + # + known = os.path.join(ssh, 'known_hosts') + if ssh_hosts: + fs.write(known, ssh_hosts) + os.chmod(known, 0o400) diff --git a/cd/__main__.py b/cd/__main__.py index c93b684..ba1ca17 100755 --- a/cd/__main__.py +++ b/cd/__main__.py @@ -10,6 +10,7 @@ if __name__ == '__main__': command, *arguments = sys.argv command = os.path.basename(command) if command == '__main__.py': + cd.set_ssh() cd.install_commands(__file__) else: command = command.replace('-', '_') diff --git a/readme.md b/readme.md index 556a91f..2492ead 100644 --- a/readme.md +++ b/readme.md @@ -41,6 +41,8 @@ from various CA, CI, OCI / OS. |:--------------|:------------------------| | 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 | From 2753d31ba6c7e56e4da656bfd8a1c7a46c615333 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 31 May 2024 00:32:52 +0200 Subject: [PATCH 241/392] fix --- cd.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/cd.sh b/cd.sh index 9c9639c..c69fb7e 100644 --- a/cd.sh +++ b/cd.sh @@ -360,7 +360,6 @@ Dir::Etc::SourceParts \"\"; "${CD_PM_APK}"|"${CD_PM_APT}") CD_PKG_SSH="openssh-client" ;; "${CD_PM_DNF}") CD_PKG_SSH="openssh-clients" ;; "${CD_PM_PACMAN}") CD_PKG_SSH="openssh" ;; - ;; esac } From 2c3f55ec9055752c7ed19a7d3877fddc8adf725a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 31 May 2024 11:33:30 +0200 Subject: [PATCH 242/392] ssh/type --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 2492ead..ebec849 100644 --- a/readme.md +++ b/readme.md @@ -69,6 +69,7 @@ from various CA, CI, OCI / OS. * write bats +* detect private key type * handle git cloning credentials * reduce single conditions with && * write Python bootstrap process From 9e8dd694d91fe5709bffd53d3c5726e4e8f37c5c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 15:25:23 +0200 Subject: [PATCH 243/392] synchronize/wip --- .forgejo/workflows/debian:bookworm.yaml | 2 +- cd/__init__.py | 19 +++++++++++++++++++ cmd/cd-synchronize.sh | 23 ----------------------- 3 files changed, 20 insertions(+), 24 deletions(-) delete mode 100755 cmd/cd-synchronize.sh diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 976d9ae..776457b 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -13,4 +13,4 @@ jobs: - run: cd-clone-branch - run: cd-build-project - run: cd-browse-workspace - - run: cd-synchronize out + - run: cd-synchronize diff --git a/cd/__init__.py b/cd/__init__.py index ac39077..b2cc47a 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -55,6 +55,24 @@ def cd_list_environment(): print(variable, '=', value) +def cd_synchronize(): + sync_host = 'rwx.work' + sync_source = 'out' + sync_user = 'cd' + # + sync_root = f'/{sync_user}/{project.branch}/{project.name}' + # + sync_target = f'{sync_user}@{sync_host}:{sync_root}' + ps.run('rsync', + '--archive', + '--delete-before', + '--verbose', + f'{sync_source}/', + f'{sync_target}/', + '--dry-run', + ) + + def install_commands(path): user = '/usr/local/bin' for command in [ @@ -62,6 +80,7 @@ def install_commands(path): 'build-project', 'clone-branch', 'list-environment', + 'synchronize', ]: print(command) os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}')) diff --git a/cmd/cd-synchronize.sh b/cmd/cd-synchronize.sh deleted file mode 100755 index 437df02..0000000 --- a/cmd/cd-synchronize.sh +++ /dev/null @@ -1,23 +0,0 @@ -[ "${1}" ] && SYNC_SOURCE="${1}" || exit - -SYNC_USER='cd' - -[ "${GITHUB_SERVER_URL}" ] \ -&& SYNC_HOST="$(basename ${GITHUB_SERVER_URL})" || exit - -[ "${SYNC_USER}" ] \ -&& SYNC_ROOT="/${SYNC_USER}" || exit -[ "${GITHUB_REF_NAME}" ] \ -&& SYNC_ROOT="${SYNC_ROOT}/${GITHUB_REF_NAME}" || exit -[ "${GITHUB_REPOSITORY}" ] \ -&& SYNC_ROOT="${SYNC_ROOT}/${GITHUB_REPOSITORY}" || exit - -SYNC_TARGET="${SYNC_USER}@${SYNC_HOST}:${SYNC_ROOT}" -[ "${2}" ] && SYNC_TARGET="${SYNC_TARGET}/${2}" - -rsync \ ---archive \ ---delete-before \ ---verbose \ -"${SYNC_SOURCE}/" \ -"${SYNC_TARGET}/" From 82d37a0940c6c5cff4c4b7ee28b5281664e4a2d5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 18:17:58 +0200 Subject: [PATCH 244/392] =?UTF-8?q?=E2=88=92eval?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .forgejo/workflows/almalinux:8.yaml | 2 +- .forgejo/workflows/almalinux:9.yaml | 2 +- .forgejo/workflows/alpine:3.18.yaml | 2 +- .forgejo/workflows/alpine:3.19.yaml | 2 +- .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 2 +- .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 2 +- .forgejo/workflows/debian:bookworm.yaml | 2 +- .forgejo/workflows/debian:bullseye.yaml | 2 +- .forgejo/workflows/fedora:39.yaml | 2 +- .forgejo/workflows/fedora:40.yaml | 2 +- .forgejo/workflows/rockylinux:8.yaml | 2 +- .forgejo/workflows/rockylinux:9.yaml | 2 +- .forgejo/workflows/ubuntu:jammy.yaml | 2 +- .forgejo/workflows/ubuntu:noble.yaml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 4931810..e62e4c9 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index 596e81f..988511b 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index 9082776..d98e892 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index 169119c..20bd15c 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index 2fb6805..e14b0dd 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index 3442cfd..207f2c7 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 776457b..327a072 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index 6a61463..11d01d2 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 7a21790..7d8fb06 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index 04568ed..d9b7beb 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index 7c002a9..07d12db 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index 66e97ae..a30fe56 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index c7b6cb4..1fcb211 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index 5f487ad..25eb191 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: eval ${{vars.cd}} + run: ${{vars.cd}} - run: cd-list-environment - run: cd-clone-branch From f854e2f874541e092bdd3530939133d9ebc1231c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 18:43:45 +0200 Subject: [PATCH 245/392] cd_ssh_hosts --- .forgejo/workflows/almalinux:8.yaml | 2 +- .forgejo/workflows/almalinux:9.yaml | 2 +- .forgejo/workflows/alpine:3.18.yaml | 2 +- .forgejo/workflows/alpine:3.19.yaml | 2 +- .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 2 +- .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 2 +- .forgejo/workflows/debian:bookworm.yaml | 2 +- .forgejo/workflows/debian:bullseye.yaml | 2 +- .forgejo/workflows/fedora:39.yaml | 2 +- .forgejo/workflows/fedora:40.yaml | 2 +- .forgejo/workflows/rockylinux:8.yaml | 2 +- .forgejo/workflows/rockylinux:9.yaml | 2 +- .forgejo/workflows/ubuntu:jammy.yaml | 2 +- .forgejo/workflows/ubuntu:noble.yaml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index e62e4c9..639180c 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index 988511b..6211ddd 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index d98e892..557e548 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index 20bd15c..41447cc 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index e14b0dd..648ff07 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index 207f2c7..60cfd91 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 327a072..680d9c9 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index 11d01d2..2d7d210 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 7d8fb06..6f45d95 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index d9b7beb..61a6941 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index 07d12db..736cf28 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index a30fe56..13e63a5 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index 1fcb211..84506a1 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index 25eb191..91c710f 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} + run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} - run: cd-list-environment - run: cd-clone-branch From efc276ee87bdfa0669a33b7594210096cf43a87e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 18:45:06 +0200 Subject: [PATCH 246/392] echo ${@} --- cd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cd.sh b/cd.sh index c69fb7e..455a94b 100644 --- a/cd.sh +++ b/cd.sh @@ -12,6 +12,7 @@ rwx \ # main cd_main () { + echo "${@}" cd_set_environment_variables cd_set_packages_repositories cd_set_packages_configuration From fe6156de6b4956070c9cffc3b46b729ef5a6d09e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 18:49:23 +0200 Subject: [PATCH 247/392] main ${@} --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 455a94b..f1f1ad3 100644 --- a/cd.sh +++ b/cd.sh @@ -719,4 +719,4 @@ CD_PM_PACMAN="pacman" CD_SPLIT="─╌╌┄┄┈┈" # run -cd_main +cd_main "${@}" From 8072b392b2e7e0967f7097d03d8f5da10d93ce42 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 19:24:27 +0200 Subject: [PATCH 248/392] quote --- .forgejo/workflows/debian:bookworm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 680d9c9..03be1c2 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch From 25567338c4a179e4b511d6414741d8af4bc7afdb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 19:39:50 +0200 Subject: [PATCH 249/392] quotes --- .forgejo/workflows/almalinux:8.yaml | 2 +- .forgejo/workflows/almalinux:9.yaml | 2 +- .forgejo/workflows/alpine:3.18.yaml | 2 +- .forgejo/workflows/alpine:3.19.yaml | 2 +- .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 2 +- .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 2 +- .forgejo/workflows/debian:bullseye.yaml | 2 +- .forgejo/workflows/fedora:39.yaml | 2 +- .forgejo/workflows/fedora:40.yaml | 2 +- .forgejo/workflows/rockylinux:8.yaml | 2 +- .forgejo/workflows/rockylinux:9.yaml | 2 +- .forgejo/workflows/ubuntu:jammy.yaml | 2 +- .forgejo/workflows/ubuntu:noble.yaml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 639180c..7ca55e6 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index 6211ddd..b39b2a2 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index 557e548..3fc3fa1 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index 41447cc..ad51687 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index 648ff07..5b097d7 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index 60cfd91..e3bccb8 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index 2d7d210..2f68dbe 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 6f45d95..8f79067 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index 61a6941..c1860a4 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index 736cf28..6749f33 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index 13e63a5..f9c39ce 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index 84506a1..163dc1d 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index 91c710f..0dfeb56 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} ${{vars.cd_ssh_hosts}} + run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" - run: cd-list-environment - run: cd-clone-branch From 61723d1e1d122852986069462ddf1761207f644e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 19:42:48 +0200 Subject: [PATCH 250/392] gitlab-ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8158f14..3eaca49 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: debian:bookworm job: script: - - source ${CD} + - source ${CD} ${CD_SSH_HOSTS} - cd-list-environment - cd-clone-branch From aa26bce5fae1741a70ed1f33ec581c2874f099e4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 19:44:01 +0200 Subject: [PATCH 251/392] main --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index f1f1ad3..455a94b 100644 --- a/cd.sh +++ b/cd.sh @@ -719,4 +719,4 @@ CD_PM_PACMAN="pacman" CD_SPLIT="─╌╌┄┄┈┈" # run -cd_main "${@}" +cd_main From 914ecb28cf5c8b4e730b6bba2660ccaf193ad0e9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 20:03:08 +0200 Subject: [PATCH 252/392] cd_python_module --- cd.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 455a94b..84e7dbc 100644 --- a/cd.sh +++ b/cd.sh @@ -5,8 +5,9 @@ CD_DEFAULT_DNS="\ 9.9.9.9 \ " +CD_PYTHON_MODULE="cd" CD_PYTHON_MODULES="\ -cd \ +${CD_PYTHON_MODULE} \ rwx \ " @@ -35,8 +36,8 @@ cd_main () { # TODO move to Python cd_install_ssh cd_clean_packages_cache - cd_install_python_modules ${CD_PYTHON_MODULES} - cd_execute_python_module ${CD_PYTHON_MODULES} + cd_install_python_modules + cd_execute_python_module "${@}" } # steps @@ -540,7 +541,7 @@ local url cd_step "Install Python modules" root="$(mktemp --directory)" || exit echo "${root}" - for repository in "${@}" ; do + for repository in ${CD_PYTHON_MODULES} ; do cd_split url="${CD_PROJECTS_URL}/${repository}" echo -n "\ @@ -571,9 +572,9 @@ local self echo -n "\ ${self} ↓ -${1} +${CD_PYTHON_MODULE} " - "${CD_PYTHON_ALIAS}" -m "${1}" "${CD_STEP}" "${self}" + "${CD_PYTHON_ALIAS}" -m "${CD_PYTHON_MODULE}" "${@}" } # functions From 5fdfd1637b12ca888cf09743d85a003c87475a7a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 20:14:06 +0200 Subject: [PATCH 253/392] arg0 --- cd/__init__.py | 4 ++-- cd/__main__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index b2cc47a..28b8c3b 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -86,8 +86,8 @@ def install_commands(path): os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}')) -def set_ssh(): - ssh_hosts = projects.environment.get('CD_SSH_HOSTS', None) +def set_ssh(*arguments): + ssh_hosts = arguments[0] ssh_key = projects.environment.get('CD', None) ssh_type = projects.environment.get('CD_SSH_TYPE', 'ed25519') # diff --git a/cd/__main__.py b/cd/__main__.py index ba1ca17..d67667f 100755 --- a/cd/__main__.py +++ b/cd/__main__.py @@ -10,7 +10,7 @@ if __name__ == '__main__': command, *arguments = sys.argv command = os.path.basename(command) if command == '__main__.py': - cd.set_ssh() + cd.set_ssh(*arguments) cd.install_commands(__file__) else: command = command.replace('-', '_') From c996993a13c8d090c186e0afe2945ad5b07c650a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 21:55:23 +0200 Subject: [PATCH 254/392] =?UTF-8?q?=E2=88=92source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3eaca49..6326c3f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: debian:bookworm job: script: - - source ${CD} ${CD_SSH_HOSTS} + - ${CD} ${CD_SSH_HOSTS} - cd-list-environment - cd-clone-branch From d2b38bfd2313bef5633deda362b429fc0eaab867 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 21:58:02 +0200 Subject: [PATCH 255/392] quote --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6326c3f..4f528aa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: debian:bookworm job: script: - - ${CD} ${CD_SSH_HOSTS} + - "${CD}" ${CD_SSH_HOSTS} - cd-list-environment - cd-clone-branch From f9c72ac4ade195b034f77a1ad24fb0f67515d57a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 22:12:07 +0200 Subject: [PATCH 256/392] sh --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4f528aa..52f3a92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: debian:bookworm job: script: - - "${CD}" ${CD_SSH_HOSTS} + - sh ${CD} ${CD_SSH_HOSTS} - cd-list-environment - cd-clone-branch From 641fab818e954b6dd51baacb72b85b6a537950b6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 22:26:36 +0200 Subject: [PATCH 257/392] main/@ --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 84e7dbc..5df56f1 100644 --- a/cd.sh +++ b/cd.sh @@ -720,4 +720,4 @@ CD_PM_PACMAN="pacman" CD_SPLIT="─╌╌┄┄┈┈" # run -cd_main +cd_main "${@}" From 327e9bdf74751d89bbd1fa92e8379148ddb3af9b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 22:44:10 +0200 Subject: [PATCH 258/392] ssh --- .forgejo/workflows/almalinux:8.yaml | 2 +- .forgejo/workflows/almalinux:9.yaml | 2 +- .forgejo/workflows/alpine:3.18.yaml | 2 +- .forgejo/workflows/alpine:3.19.yaml | 2 +- .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 2 +- .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 2 +- .forgejo/workflows/debian:bookworm.yaml | 2 +- .forgejo/workflows/debian:bullseye.yaml | 2 +- .forgejo/workflows/fedora:39.yaml | 2 +- .forgejo/workflows/fedora:40.yaml | 2 +- .forgejo/workflows/rockylinux:8.yaml | 2 +- .forgejo/workflows/rockylinux:9.yaml | 2 +- .forgejo/workflows/ubuntu:jammy.yaml | 2 +- .forgejo/workflows/ubuntu:noble.yaml | 2 +- .gitlab-ci.yml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 7ca55e6..211d932 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index b39b2a2..e165951 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index 3fc3fa1..926dd55 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index ad51687..1d74fe0 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index 5b097d7..2d0d8c9 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index e3bccb8..77ea39c 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 03be1c2..162e5f5 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index 2f68dbe..a093e85 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 8f79067..6ce1a7f 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index c1860a4..b1104db 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index 6749f33..2068399 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index f9c39ce..d66a5fd 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index 163dc1d..d1aba41 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index 0dfeb56..6d8c598 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -7,7 +7,7 @@ jobs: - name: cd env: CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_ssh_hosts}}" + run: ${{vars.cd}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52f3a92..8f2ba1c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: debian:bookworm job: script: - - sh ${CD} ${CD_SSH_HOSTS} + - sh ${CD} ${CD_HOSTS} - cd-list-environment - cd-clone-branch From 27091dde5fb1f71782bf674857f2d67066e9f6d7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 23:31:41 +0200 Subject: [PATCH 259/392] cd_key --- .forgejo/workflows/almalinux:8.yaml | 4 +--- .forgejo/workflows/almalinux:9.yaml | 4 +--- .forgejo/workflows/alpine:3.18.yaml | 4 +--- .forgejo/workflows/alpine:3.19.yaml | 4 +--- .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 4 +--- .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 4 +--- .forgejo/workflows/debian:bookworm.yaml | 4 +--- .forgejo/workflows/debian:bullseye.yaml | 4 +--- .forgejo/workflows/fedora:39.yaml | 4 +--- .forgejo/workflows/fedora:40.yaml | 4 +--- .forgejo/workflows/rockylinux:8.yaml | 4 +--- .forgejo/workflows/rockylinux:9.yaml | 4 +--- .forgejo/workflows/ubuntu:jammy.yaml | 4 +--- .forgejo/workflows/ubuntu:noble.yaml | 4 +--- .gitlab-ci.yml | 2 +- cd.sh | 1 - 16 files changed, 15 insertions(+), 44 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 211d932..0230fd1 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -5,9 +5,7 @@ jobs: image: almalinux:8 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index e165951..2211b6f 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -5,9 +5,7 @@ jobs: image: almalinux:9 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index 926dd55..40634fb 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -5,9 +5,7 @@ jobs: image: alpine:3.18 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index 1d74fe0..50f0d83 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -5,9 +5,7 @@ jobs: image: alpine:3.19 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index 2d0d8c9..556d13f 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -5,9 +5,7 @@ jobs: image: archlinux:base-20231112.0.191179 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index 77ea39c..2124329 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -5,9 +5,7 @@ jobs: image: archlinux:base-20240101.0.204074 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 162e5f5..1235d43 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -5,9 +5,7 @@ jobs: image: debian:bookworm steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index a093e85..d5b8911 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -5,9 +5,7 @@ jobs: image: debian:bullseye steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 6ce1a7f..41489f4 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -5,9 +5,7 @@ jobs: image: fedora:39 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index b1104db..c6b6ffb 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -5,9 +5,7 @@ jobs: image: fedora:40 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index 2068399..d9bd3cf 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -5,9 +5,7 @@ jobs: image: rockylinux:8 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index d66a5fd..dc79d23 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -5,9 +5,7 @@ jobs: image: rockylinux:9 steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index d1aba41..d171087 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -5,9 +5,7 @@ jobs: image: ubuntu:jammy steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index 6d8c598..9768c6f 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -5,9 +5,7 @@ jobs: image: ubuntu:noble steps: - name: cd - env: - CD: ${{secrets.cd}} - run: ${{vars.cd}} "${{vars.cd_hosts}}" + run: ${{vars.cd}} ${{secrets.cd_key}} "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8f2ba1c..3902191 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: debian:bookworm job: script: - - sh ${CD} ${CD_HOSTS} + - sh ${CD} ${CD_KEY} ${CD_HOSTS} - cd-list-environment - cd-clone-branch diff --git a/cd.sh b/cd.sh index 5df56f1..84992e7 100644 --- a/cd.sh +++ b/cd.sh @@ -13,7 +13,6 @@ rwx \ # main cd_main () { - echo "${@}" cd_set_environment_variables cd_set_packages_repositories cd_set_packages_configuration From ff7eacddefcb950baafbbcf4b23b6daa3817c88d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 1 Jun 2024 23:55:16 +0200 Subject: [PATCH 260/392] quotes --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3902191..1ac9143 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ image: debian:bookworm job: script: - - sh ${CD} ${CD_KEY} ${CD_HOSTS} + - sh ${CD} "${CD_KEY}" "${CD_HOSTS}" - cd-list-environment - cd-clone-branch From 27738ea0452544a05ae9b4e8cff59d787cc3a6a6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 00:08:15 +0200 Subject: [PATCH 261/392] quotes --- .forgejo/workflows/almalinux:8.yaml | 2 +- .forgejo/workflows/almalinux:9.yaml | 2 +- .forgejo/workflows/alpine:3.18.yaml | 2 +- .forgejo/workflows/alpine:3.19.yaml | 2 +- .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 2 +- .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 2 +- .forgejo/workflows/debian:bookworm.yaml | 2 +- .forgejo/workflows/debian:bullseye.yaml | 2 +- .forgejo/workflows/fedora:39.yaml | 2 +- .forgejo/workflows/fedora:40.yaml | 2 +- .forgejo/workflows/rockylinux:8.yaml | 2 +- .forgejo/workflows/rockylinux:9.yaml | 2 +- .forgejo/workflows/ubuntu:jammy.yaml | 2 +- .forgejo/workflows/ubuntu:noble.yaml | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 0230fd1..6a5b327 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index 2211b6f..bf06ca3 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index 40634fb..880031e 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index 50f0d83..5ed484c 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index 556d13f..e48e21f 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index 2124329..e73cf51 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 1235d43..23619ec 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index d5b8911..17da330 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 41489f4..15e886a 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index c6b6ffb..1c527d4 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index d9bd3cf..e3eebaa 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index dc79d23..ed15281 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index d171087..d9c4a9b 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index 9768c6f..b23f63b 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -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_key}}" "${{vars.cd_hosts}}" - run: cd-list-environment - run: cd-clone-branch From 34ed31e3aa0cdc44dae3ae6537b51baa266e3437 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 00:51:21 +0200 Subject: [PATCH 262/392] args --- cd/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 28b8c3b..05ae1d1 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -87,8 +87,7 @@ def install_commands(path): def set_ssh(*arguments): - ssh_hosts = arguments[0] - ssh_key = projects.environment.get('CD', None) + ssh_key, ssh_hosts = arguments ssh_type = projects.environment.get('CD_SSH_TYPE', 'ed25519') # home = os.path.expanduser('~') From a6b8990f4b6e2d2cb613df6738c0cc6c664161e8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 12:41:46 +0200 Subject: [PATCH 263/392] group --- cd/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 05ae1d1..da21c09 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -56,19 +56,20 @@ def cd_list_environment(): def cd_synchronize(): - sync_host = 'rwx.work' - sync_source = 'out' - sync_user = 'cd' + host = 'rwx.work' + source = 'out' + user = 'cd' # - sync_root = f'/{sync_user}/{project.branch}/{project.name}' + root = os.sep.join([str(), + user, project.branch, projects.group, project.name]) # - sync_target = f'{sync_user}@{sync_host}:{sync_root}' + target = f'{user}@{host}:{root}' ps.run('rsync', '--archive', '--delete-before', '--verbose', - f'{sync_source}/', - f'{sync_target}/', + f'{source}/', + f'{target}/', '--dry-run', ) From 60b377e3561c69a58277fe2b493e273ee0588ca8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 15:43:45 +0200 Subject: [PATCH 264/392] ssh --- .forgejo/workflows/almalinux:8.yaml | 2 +- .forgejo/workflows/almalinux:9.yaml | 2 +- .forgejo/workflows/alpine:3.18.yaml | 2 +- .forgejo/workflows/alpine:3.19.yaml | 2 +- .forgejo/workflows/archlinux:base-20231112.0.191179.yaml | 2 +- .forgejo/workflows/archlinux:base-20240101.0.204074.yaml | 2 +- .forgejo/workflows/debian:bookworm.yaml | 2 +- .forgejo/workflows/debian:bullseye.yaml | 2 +- .forgejo/workflows/fedora:39.yaml | 2 +- .forgejo/workflows/fedora:40.yaml | 2 +- .forgejo/workflows/rockylinux:8.yaml | 2 +- .forgejo/workflows/rockylinux:9.yaml | 2 +- .forgejo/workflows/ubuntu:jammy.yaml | 2 +- .forgejo/workflows/ubuntu:noble.yaml | 2 +- .gitlab-ci.yml | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.forgejo/workflows/almalinux:8.yaml b/.forgejo/workflows/almalinux:8.yaml index 6a5b327..119a65d 100644 --- a/.forgejo/workflows/almalinux:8.yaml +++ b/.forgejo/workflows/almalinux:8.yaml @@ -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 diff --git a/.forgejo/workflows/almalinux:9.yaml b/.forgejo/workflows/almalinux:9.yaml index bf06ca3..1adbd7c 100644 --- a/.forgejo/workflows/almalinux:9.yaml +++ b/.forgejo/workflows/almalinux:9.yaml @@ -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 diff --git a/.forgejo/workflows/alpine:3.18.yaml b/.forgejo/workflows/alpine:3.18.yaml index 880031e..bb87efb 100644 --- a/.forgejo/workflows/alpine:3.18.yaml +++ b/.forgejo/workflows/alpine:3.18.yaml @@ -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 diff --git a/.forgejo/workflows/alpine:3.19.yaml b/.forgejo/workflows/alpine:3.19.yaml index 5ed484c..98437d5 100644 --- a/.forgejo/workflows/alpine:3.19.yaml +++ b/.forgejo/workflows/alpine:3.19.yaml @@ -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 diff --git a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml index e48e21f..be6085d 100644 --- a/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml +++ b/.forgejo/workflows/archlinux:base-20231112.0.191179.yaml @@ -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 diff --git a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml index e73cf51..0f9a097 100644 --- a/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml +++ b/.forgejo/workflows/archlinux:base-20240101.0.204074.yaml @@ -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 diff --git a/.forgejo/workflows/debian:bookworm.yaml b/.forgejo/workflows/debian:bookworm.yaml index 23619ec..c6f4ae1 100644 --- a/.forgejo/workflows/debian:bookworm.yaml +++ b/.forgejo/workflows/debian:bookworm.yaml @@ -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 diff --git a/.forgejo/workflows/debian:bullseye.yaml b/.forgejo/workflows/debian:bullseye.yaml index 17da330..7a1d736 100644 --- a/.forgejo/workflows/debian:bullseye.yaml +++ b/.forgejo/workflows/debian:bullseye.yaml @@ -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 diff --git a/.forgejo/workflows/fedora:39.yaml b/.forgejo/workflows/fedora:39.yaml index 15e886a..aad0848 100644 --- a/.forgejo/workflows/fedora:39.yaml +++ b/.forgejo/workflows/fedora:39.yaml @@ -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 diff --git a/.forgejo/workflows/fedora:40.yaml b/.forgejo/workflows/fedora:40.yaml index 1c527d4..fd1d5f9 100644 --- a/.forgejo/workflows/fedora:40.yaml +++ b/.forgejo/workflows/fedora:40.yaml @@ -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 diff --git a/.forgejo/workflows/rockylinux:8.yaml b/.forgejo/workflows/rockylinux:8.yaml index e3eebaa..54a1962 100644 --- a/.forgejo/workflows/rockylinux:8.yaml +++ b/.forgejo/workflows/rockylinux:8.yaml @@ -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 diff --git a/.forgejo/workflows/rockylinux:9.yaml b/.forgejo/workflows/rockylinux:9.yaml index ed15281..64d98a4 100644 --- a/.forgejo/workflows/rockylinux:9.yaml +++ b/.forgejo/workflows/rockylinux:9.yaml @@ -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 diff --git a/.forgejo/workflows/ubuntu:jammy.yaml b/.forgejo/workflows/ubuntu:jammy.yaml index d9c4a9b..33c4578 100644 --- a/.forgejo/workflows/ubuntu:jammy.yaml +++ b/.forgejo/workflows/ubuntu:jammy.yaml @@ -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 diff --git a/.forgejo/workflows/ubuntu:noble.yaml b/.forgejo/workflows/ubuntu:noble.yaml index b23f63b..739ca7c 100644 --- a/.forgejo/workflows/ubuntu:noble.yaml +++ b/.forgejo/workflows/ubuntu:noble.yaml @@ -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 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ac9143..a3634f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 From 4be78a3d0e564827b36a91cc2bb31e847d0d4b4b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 15:46:36 +0200 Subject: [PATCH 265/392] cd_git_child --- cd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 84992e7..75c9379 100644 --- a/cd.sh +++ b/cd.sh @@ -5,9 +5,9 @@ CD_DEFAULT_DNS="\ 9.9.9.9 \ " -CD_PYTHON_MODULE="cd" +CD_GIT_CHILD="cd" CD_PYTHON_MODULES="\ -${CD_PYTHON_MODULE} \ +${CD_GIT_CHILD} \ rwx \ " @@ -571,9 +571,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 From 5b3122aaf2cef0bf4095d1ad8b2acd9324703f06 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 15:50:44 +0200 Subject: [PATCH 266/392] cd_git_parent --- cd.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 75c9379..a8a9701 100644 --- a/cd.sh +++ b/cd.sh @@ -5,11 +5,8 @@ CD_DEFAULT_DNS="\ 9.9.9.9 \ " -CD_GIT_CHILD="cd" -CD_PYTHON_MODULES="\ -${CD_GIT_CHILD} \ -rwx \ -" +[ "${CD_GIT_CHILD}" ] || CD_GIT_CHILD="cd" +[ "${CD_GIT_PARENT}" ] || CD_GIT_PARENT="rwx" # main cd_main () { @@ -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 "\ From 8718ba1e579a9dfa9de09b83773a35fe67d067d2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 15:55:53 +0200 Subject: [PATCH 267/392] cd_dns --- cd.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index a8a9701..fa36dea 100644 --- a/cd.sh +++ b/cd.sh @@ -1,10 +1,9 @@ #! /usr/bin/env sh # defaults -CD_DEFAULT_DNS="\ +[ "${CD_DNS}" ] || CD_DNS="\ 9.9.9.9 \ " - [ "${CD_GIT_CHILD}" ] || CD_GIT_CHILD="cd" [ "${CD_GIT_PARENT}" ] || CD_GIT_PARENT="rwx" @@ -441,11 +440,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 From 1f5fe6900c71419d92d40ce034b5c5b77f5dc306 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 16:01:06 +0200 Subject: [PATCH 268/392] readme/git,default --- readme.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/readme.md b/readme.md index ebec849..a061e7f 100644 --- a/readme.md +++ b/readme.md @@ -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 | | +| 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 | | +| 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 | | ## HTTPS & Python From 4e9afd7e5d6e415d791b15c0231b591e326e5b1b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 2 Jun 2024 16:29:41 +0200 Subject: [PATCH 269/392] arch,readme --- cd.sh | 3 +++ readme.md | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cd.sh b/cd.sh index fa36dea..659109d 100644 --- a/cd.sh +++ b/cd.sh @@ -252,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" diff --git a/readme.md b/readme.md index a061e7f..3b607dd 100644 --- a/readme.md +++ b/readme.md @@ -37,21 +37,21 @@ from various CA, CI, OCI / OS. ## How -| Variable | Description | Default | -|:--------------|:------------------------|:--------| -| CD_CA_n | Numbered CA certificate | | -| CD_DNS | Space separated servers | | -| 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 | | -| 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 From 7e7fc52d5405664b38b174a9f23cf55b16f36c95 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 3 Jun 2024 03:36:56 +0200 Subject: [PATCH 270/392] inject/test --- cd.sh | 8 +++++++- cd/__init__.py | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 659109d..0d5912a 100644 --- a/cd.sh +++ b/cd.sh @@ -564,6 +564,12 @@ ${CD_PYTHON_PACKAGES} cd_execute_python_module () { local self cd_step "Execute Python module" + # + cd_echo \ + "CD_OS_ID" "CD_OS_VERSION" \ + "CD_SPLIT" \ + > "${CD_PYTHON_PACKAGES}/env.py" + # self="$(realpath "${0}")" echo -n "\ ${self} @@ -586,7 +592,7 @@ cd_echo () { local name if [ "${1}" ] ; then for name in "${@}" ; do - eval "echo ${name}=\${${name}}" + eval "echo ${name} = '\${${name}}'" done fi } diff --git a/cd/__init__.py b/cd/__init__.py index da21c09..7c1660a 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -2,6 +2,10 @@ import os from cd.project import Project from cd.projects import Projects +import env +print(CD_OS_ID) +print(CD_SPLIT) +print(CD_OS_VERSION) from rwx import fs from rwx import ps From fe81abda481889f990114c4160b124712286d4a2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 3 Jun 2024 03:49:48 +0200 Subject: [PATCH 271/392] \" --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 0d5912a..8c26638 100644 --- a/cd.sh +++ b/cd.sh @@ -592,7 +592,7 @@ cd_echo () { local name if [ "${1}" ] ; then for name in "${@}" ; do - eval "echo ${name} = '\${${name}}'" + eval "echo ${name} = \"\${${name}}\"" done fi } From 619f2eea869f44edd8c1e2662cbbd77f401353af Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 3 Jun 2024 03:57:36 +0200 Subject: [PATCH 272/392] \\\" --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 8c26638..607d7da 100644 --- a/cd.sh +++ b/cd.sh @@ -592,7 +592,7 @@ cd_echo () { local name if [ "${1}" ] ; then for name in "${@}" ; do - eval "echo ${name} = \"\${${name}}\"" + eval "echo ${name} = \\\"\${${name}}\\\"" done fi } From 74bfd6ba1cad499551c71e65364e201d3ac0bf84 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 3 Jun 2024 04:14:37 +0200 Subject: [PATCH 273/392] fixes --- cd.sh | 10 ++++++---- cd/__init__.py | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index 607d7da..f6fd24b 100644 --- a/cd.sh +++ b/cd.sh @@ -562,17 +562,19 @@ ${CD_PYTHON_PACKAGES} } cd_execute_python_module () { -local self +local path cd_step "Execute Python module" # + path="${CD_PYTHON_PACKAGES}/env.py" cd_echo \ "CD_OS_ID" "CD_OS_VERSION" \ "CD_SPLIT" \ - > "${CD_PYTHON_PACKAGES}/env.py" + > "${path}" || exit + cd_cat "${path}" # - self="$(realpath "${0}")" + path="$(realpath "${0}")" echo -n "\ -${self} +${path} ↓ ${CD_GIT_CHILD} " diff --git a/cd/__init__.py b/cd/__init__.py index 7c1660a..676f867 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -3,9 +3,9 @@ import os from cd.project import Project from cd.projects import Projects import env -print(CD_OS_ID) -print(CD_SPLIT) -print(CD_OS_VERSION) +print(env.CD_OS_ID) +print(env.CD_SPLIT) +print(env.CD_OS_VERSION) from rwx import fs from rwx import ps From fd7230ebe3801b02ec813f1a72ca28e96b5a86e1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 3 Jun 2024 04:33:10 +0200 Subject: [PATCH 274/392] cd_write --- cd.sh | 12 ++++++------ cd/__init__.py | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/cd.sh b/cd.sh index f6fd24b..64e8088 100644 --- a/cd.sh +++ b/cd.sh @@ -565,12 +565,12 @@ cd_execute_python_module () { local path cd_step "Execute Python module" # - path="${CD_PYTHON_PACKAGES}/env.py" - cd_echo \ - "CD_OS_ID" "CD_OS_VERSION" \ - "CD_SPLIT" \ - > "${path}" || exit - cd_cat "${path}" + cd_write "${CD_PYTHON_PACKAGES}/env.py" "$(cd_echo \ + CD_OS_ID CD_OS_VERSION \ + CD_SPLIT \ + )" + # + cd_split # path="$(realpath "${0}")" echo -n "\ diff --git a/cd/__init__.py b/cd/__init__.py index 676f867..279a18f 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -3,9 +3,6 @@ import os from cd.project import Project from cd.projects import Projects import env -print(env.CD_OS_ID) -print(env.CD_SPLIT) -print(env.CD_OS_VERSION) from rwx import fs from rwx import ps From 1104b415c2b3d99f300e4561bbbe5517a724bba0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 3 Jun 2024 21:00:28 +0200 Subject: [PATCH 275/392] lf/https --- cd.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 64e8088..9713c98 100644 --- a/cd.sh +++ b/cd.sh @@ -170,7 +170,9 @@ installonly_limit=3 skip_if_unavailable=False " CD_PM_HTTPS_PATH="/etc/dnf/dnf.conf.d/https.conf" - CD_PM_HTTPS_TEXT="sslverify=False" + CD_PM_HTTPS_TEXT="\ +sslverify=False +" ;; "${CD_PM_APK}") CD_PM_CLEAN="apk cache purge" @@ -182,7 +184,9 @@ skip_if_unavailable=False CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" CD_PM_HTTPS_PATH="/etc/apk/repositories.d/https" - CD_PM_HTTPS_TEXT="--no-verify" + CD_PM_HTTPS_TEXT="\ +--no-verify +" ;; "${CD_PM_PACMAN}") CD_PM_CLEAN="pacman --sync --clean --noconfirm" @@ -194,7 +198,9 @@ skip_if_unavailable=False CD_PM_CONF_PATH="" CD_PM_CONF_TEXT="" CD_PM_HTTPS_PATH="/etc/pacman.d/https.conf" - CD_PM_HTTPS_TEXT="SSLVerify = No" + CD_PM_HTTPS_TEXT="\ +SSLVerify = No +" ;; "${CD_PM_APT}") CD_PM_CLEAN="apt-get clean" @@ -212,7 +218,9 @@ APT::Install-Suggests False; Dir::Etc::SourceParts \"\"; " CD_PM_HTTPS_PATH="/etc/apt/apt.conf.d/https" - CD_PM_HTTPS_TEXT="Acquire::https::Verify-Peer False;" + CD_PM_HTTPS_TEXT="\ +Acquire::https::Verify-Peer False; +" ;; esac cd_split From 2106a7ea9357f3c845b1dba0395e34fc497592ad Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 09:18:54 +0200 Subject: [PATCH 276/392] lf --- cd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 9713c98..34f8e8d 100644 --- a/cd.sh +++ b/cd.sh @@ -573,10 +573,10 @@ cd_execute_python_module () { local path cd_step "Execute Python module" # - cd_write "${CD_PYTHON_PACKAGES}/env.py" "$(cd_echo \ - CD_OS_ID CD_OS_VERSION \ - CD_SPLIT \ - )" + cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +$(cd_echo CD_OS_ID CD_OS_VERSION) +$(cd_echo CD_SPLIT) +" # cd_split # From f1d1c627714fa6bb2a1185587df5e8adfb897bf8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 10:09:41 +0200 Subject: [PATCH 277/392] empty --- cd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cd.sh b/cd.sh index 34f8e8d..e46fdb5 100644 --- a/cd.sh +++ b/cd.sh @@ -575,6 +575,7 @@ local path # cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ $(cd_echo CD_OS_ID CD_OS_VERSION) + $(cd_echo CD_SPLIT) " # From 2fa331302cb0ac4dde26337ec73ff008ec9b4016 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 18:46:38 +0200 Subject: [PATCH 278/392] box/down,left --- cd.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index e46fdb5..c8169cb 100644 --- a/cd.sh +++ b/cd.sh @@ -594,7 +594,7 @@ ${CD_GIT_CHILD} cd_cat () { if [ "${1}" ] ; then - echo "╭╴$(realpath "${1}")" + echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" cat "${1}" || exit fi } @@ -645,7 +645,7 @@ local command="${1}" cd_ls () { if [ "${1}" ] ; then - echo "╭╴$(realpath "${1}")" + echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" ls -a -l "${1}" || exit fi } @@ -695,7 +695,7 @@ cd_split () { cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ -╭${CD_SPLIT} +${CD_BOX_DOWN}${CD_SPLIT} │ ${CD_STEP} ${@} ╰${CD_SPLIT} " @@ -714,6 +714,9 @@ local text="${2}" # constants +CD_BOX_DOWN="╭" +CD_BOX_LEFT="╴" + CD_ERROR_CI=2 CD_ERROR_OS=1 From 461c798983ab0f4f79784cb1b1b2dcab96beb917 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 18:51:15 +0200 Subject: [PATCH 279/392] box/horizontal,vertical --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index c8169cb..f67399d 100644 --- a/cd.sh +++ b/cd.sh @@ -688,16 +688,16 @@ shift cd_split () { echo -n "\ -╶${CD_SPLIT} +╶${CD_BOX_HORIZONTAL} " } cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ -${CD_BOX_DOWN}${CD_SPLIT} -│ ${CD_STEP} ${@} -╰${CD_SPLIT} +${CD_BOX_DOWN}${CD_BOX_HORIZONTAL} +${CD_BOX_VERTICAL} ${CD_STEP} ${@} +╰${CD_BOX_HORIZONTAL} " } @@ -715,7 +715,9 @@ local text="${2}" # constants CD_BOX_DOWN="╭" +CD_BOX_HORIZONTAL="─╌╌┄┄┈┈" CD_BOX_LEFT="╴" +CD_BOX_VERTICAL="│" CD_ERROR_CI=2 CD_ERROR_OS=1 @@ -733,7 +735,5 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" -CD_SPLIT="─╌╌┄┄┈┈" - # run cd_main "${@}" From 1c45fd6ff65c756059e04a73c7dd0c7828c42052 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 18:53:29 +0200 Subject: [PATCH 280/392] box/right,up --- cd.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index f67399d..3feee96 100644 --- a/cd.sh +++ b/cd.sh @@ -688,7 +688,7 @@ shift cd_split () { echo -n "\ -╶${CD_BOX_HORIZONTAL} +${CD_BOX_RIGHT}${CD_BOX_HORIZONTAL} " } @@ -697,7 +697,7 @@ cd_step () { echo -n "\ ${CD_BOX_DOWN}${CD_BOX_HORIZONTAL} ${CD_BOX_VERTICAL} ${CD_STEP} ${@} -╰${CD_BOX_HORIZONTAL} +${CD_BOX_UP}${CD_BOX_HORIZONTAL} " } @@ -717,6 +717,8 @@ local text="${2}" CD_BOX_DOWN="╭" CD_BOX_HORIZONTAL="─╌╌┄┄┈┈" CD_BOX_LEFT="╴" +CD_BOX_RIGHT="╶" +CD_BOX_UP="╰" CD_BOX_VERTICAL="│" CD_ERROR_CI=2 From 768ebd47566d0ca12ae1e72de4ab0eb2c8b9ab9e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 19:11:52 +0200 Subject: [PATCH 281/392] box,ls --- cd.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 3feee96..c5768e7 100644 --- a/cd.sh +++ b/cd.sh @@ -592,6 +592,16 @@ ${CD_GIT_CHILD} # functions +cd_box_more () { + echo "${CD_BOX_VERTICAL} ${@}" +} +cd_box_open () { + echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" +} +cd_box_shut () { + echo "${CD_BOX_UP}${CD_BOX_LEFT} ${@}" +} + cd_cat () { if [ "${1}" ] ; then echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" @@ -644,9 +654,12 @@ local command="${1}" } cd_ls () { - if [ "${1}" ] ; then - echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" +local path + if [ -d "${1}" ] ; then + path="$(realpath "${1}")" + cd_box_open "${split}" ls -a -l "${1}" || exit + cd_box_shut "${split}" fi } From b8f5e00296f6b268e0b035307027d56a2126b46f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 19:12:35 +0200 Subject: [PATCH 282/392] ln_py --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index c5768e7..b9a54ac 100644 --- a/cd.sh +++ b/cd.sh @@ -648,7 +648,7 @@ cd_install_package () { cd_ln_python () { local command="${1}" if [ "${command}" ] ; then - echo "${CD_PYTHON_ALIAS} → ${command}" + echo "→ ${CD_PYTHON_ALIAS} → ${command}" ln -f -s "${command}" "/usr/bin/${CD_PYTHON_ALIAS}" || exit fi } From 42189dd17110fa5ebcdb743d3a450c1be8b53b84 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 19:18:32 +0200 Subject: [PATCH 283/392] cat,ls --- cd.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cd.sh b/cd.sh index b9a54ac..b7b74cb 100644 --- a/cd.sh +++ b/cd.sh @@ -592,9 +592,6 @@ ${CD_GIT_CHILD} # functions -cd_box_more () { - echo "${CD_BOX_VERTICAL} ${@}" -} cd_box_open () { echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" } @@ -603,9 +600,10 @@ cd_box_shut () { } cd_cat () { - if [ "${1}" ] ; then - echo "${CD_BOX_DOWN}${CD_BOX_LEFT}$(realpath "${1}")" + if [ -f "${1}" ] ; then + cd_box_open "${1}" cat "${1}" || exit + cd_box_shut "${1}" fi } @@ -654,12 +652,10 @@ local command="${1}" } cd_ls () { -local path if [ -d "${1}" ] ; then - path="$(realpath "${1}")" - cd_box_open "${split}" + cd_box_open "${1}" ls -a -l "${1}" || exit - cd_box_shut "${split}" + cd_box_shut "${1}" fi } From 3143207974bf81b34c11299c66e19f873cd668c5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 19:59:35 +0200 Subject: [PATCH 284/392] paths --- cd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index b7b74cb..ec5c812 100644 --- a/cd.sh +++ b/cd.sh @@ -438,7 +438,7 @@ cd_set_packages_configuration () { cd_list_working_directory () { cd_step "List working directory" - cd_ls "." + cd_ls "$(realpath .)" } cd_set_https_verification_off () { @@ -593,10 +593,10 @@ ${CD_GIT_CHILD} # functions cd_box_open () { - echo "${CD_BOX_DOWN}${CD_BOX_LEFT} ${@}" + echo "${CD_BOX_DOWN}${CD_BOX_LEFT}${@}" } cd_box_shut () { - echo "${CD_BOX_UP}${CD_BOX_LEFT} ${@}" + echo "${CD_BOX_UP}${CD_BOX_LEFT}${@}" } cd_cat () { From ecb4f805fef4bce7727adf52d26867cb8d1b4826 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:01:23 +0200 Subject: [PATCH 285/392] todo --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 3b607dd..2e512e1 100644 --- a/readme.md +++ b/readme.md @@ -73,6 +73,7 @@ from various CA, CI, OCI / OS. * detect private key type * handle git cloning credentials +* install rstnc and ssh from Python * reduce single conditions with && * write Python bootstrap process From d638c7c0599324683e650e10348e955dd68ddf18 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:10:29 +0200 Subject: [PATCH 286/392] split --- cd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index ec5c812..4ab4ea5 100644 --- a/cd.sh +++ b/cd.sh @@ -696,9 +696,7 @@ shift } cd_split () { - echo -n "\ -${CD_BOX_RIGHT}${CD_BOX_HORIZONTAL} -" + echo "${CD_SPLIT}" } cd_step () { @@ -746,5 +744,7 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" +CD_SPLIT="${CD_BOX_RIGHT}${CD_BOX_HORIZONTAL}" + # run cd_main "${@}" From 207aaf31330b191551caf49dccc94ca60eda7714 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:15:06 +0200 Subject: [PATCH 287/392] box/open,shut --- cd.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 4ab4ea5..7ff7b2a 100644 --- a/cd.sh +++ b/cd.sh @@ -593,10 +593,10 @@ ${CD_GIT_CHILD} # functions cd_box_open () { - echo "${CD_BOX_DOWN}${CD_BOX_LEFT}${@}" + echo "${CD_BOX_OPEN}${@}" } cd_box_shut () { - echo "${CD_BOX_UP}${CD_BOX_LEFT}${@}" + echo "${CD_BOX_SHUT}${@}" } cd_cat () { @@ -744,6 +744,8 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" +CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" +CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" CD_SPLIT="${CD_BOX_RIGHT}${CD_BOX_HORIZONTAL}" # run From cd684c2939a23bc039b8ad8ddabe047012bda570 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:15:42 +0200 Subject: [PATCH 288/392] open,shut --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 7ff7b2a..ab75c04 100644 --- a/cd.sh +++ b/cd.sh @@ -576,7 +576,7 @@ local path cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ $(cd_echo CD_OS_ID CD_OS_VERSION) -$(cd_echo CD_SPLIT) +$(cd_echo CD_OPEN CD_SHUT CD_SPLIT) " # cd_split From 35eba2088aee47859f5d15d383fb7075676af620 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:16:43 +0200 Subject: [PATCH 289/392] last --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 2e512e1..981cca5 100644 --- a/readme.md +++ b/readme.md @@ -80,3 +80,4 @@ from various CA, CI, OCI / OS. * integrate project repository cloning * override repository and framework locations * show previous states of directories & files +* split switch to Python step From d8682854845bd5eef71d52de79b5e6a73343186d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:23:34 +0200 Subject: [PATCH 290/392] horizontal --- cd.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index ab75c04..e7fd0b3 100644 --- a/cd.sh +++ b/cd.sh @@ -576,7 +576,7 @@ local path cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ $(cd_echo CD_OS_ID CD_OS_VERSION) -$(cd_echo CD_OPEN CD_SHUT CD_SPLIT) +$(cd_echo CD_HORIZONTAL CD_OPEN CD_SHUT CD_SPLIT) " # cd_split @@ -702,9 +702,9 @@ cd_split () { cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ -${CD_BOX_DOWN}${CD_BOX_HORIZONTAL} +${CD_BOX_DOWN}${CD_HORIZONTAL} ${CD_BOX_VERTICAL} ${CD_STEP} ${@} -${CD_BOX_UP}${CD_BOX_HORIZONTAL} +${CD_BOX_UP}${CD_HORIZONTAL} " } @@ -722,7 +722,7 @@ local text="${2}" # constants CD_BOX_DOWN="╭" -CD_BOX_HORIZONTAL="─╌╌┄┄┈┈" +CD_BOX_HORIZONTAL="─" CD_BOX_LEFT="╴" CD_BOX_RIGHT="╶" CD_BOX_UP="╰" @@ -744,9 +744,10 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" +CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" -CD_SPLIT="${CD_BOX_RIGHT}${CD_BOX_HORIZONTAL}" +CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" # run cd_main "${@}" From 51f24cabcd6aa0a6cc8fe33e61f3a450814010ce Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:33:27 +0200 Subject: [PATCH 291/392] draw --- cd.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index e7fd0b3..b794c4a 100644 --- a/cd.sh +++ b/cd.sh @@ -576,7 +576,12 @@ local path cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ $(cd_echo CD_OS_ID CD_OS_VERSION) -$(cd_echo CD_HORIZONTAL CD_OPEN CD_SHUT CD_SPLIT) + +$(cd_echo CD_OPEN CD_SHUT) + +$(cd_echo CD_HORIZONTAL) + +$(cd_echo CD_DOWN CD_SPLIT CD_UP) " # cd_split @@ -702,9 +707,9 @@ cd_split () { cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ -${CD_BOX_DOWN}${CD_HORIZONTAL} +${CD_DOWN} ${CD_BOX_VERTICAL} ${CD_STEP} ${@} -${CD_BOX_UP}${CD_HORIZONTAL} +${CD_UP} " } @@ -744,10 +749,14 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" -CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" + +CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" + +CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" +CD_UP="${CD_BOX_UP}${CD_HORIZONTAL}" # run cd_main "${@}" From 74d4d86f17ed5a6c8d5680d2eefdcc8b0b51919a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 20:47:19 +0200 Subject: [PATCH 292/392] fix --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index b794c4a..173176f 100644 --- a/cd.sh +++ b/cd.sh @@ -598,10 +598,10 @@ ${CD_GIT_CHILD} # functions cd_box_open () { - echo "${CD_BOX_OPEN}${@}" + echo "${CD_OPEN}${@}" } cd_box_shut () { - echo "${CD_BOX_SHUT}${@}" + echo "${CD_SHUT}${@}" } cd_cat () { From 4be860e4cd88d1a6fbd9b221e655e5dd161ad42d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 21:13:08 +0200 Subject: [PATCH 293/392] split --- cd.sh | 16 +++++++++------- readme.md | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index 173176f..70add07 100644 --- a/cd.sh +++ b/cd.sh @@ -32,7 +32,8 @@ cd_main () { cd_install_ssh cd_clean_packages_cache cd_install_python_modules - cd_execute_python_module "${@}" + cd_write_python_module + cd_switch_to_python "${@}" } # steps @@ -569,10 +570,8 @@ ${CD_PYTHON_PACKAGES} cd_rm "${root}" } -cd_execute_python_module () { -local path - cd_step "Execute Python module" - # +cd_write_python_module () { + cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ $(cd_echo CD_OS_ID CD_OS_VERSION) @@ -583,8 +582,11 @@ $(cd_echo CD_HORIZONTAL) $(cd_echo CD_DOWN CD_SPLIT CD_UP) " - # - cd_split +} + +cd_switch_to_python () { +local path + cd_step "Switch to Python" # path="$(realpath "${0}")" echo -n "\ diff --git a/readme.md b/readme.md index 981cca5..33bf913 100644 --- a/readme.md +++ b/readme.md @@ -80,4 +80,4 @@ from various CA, CI, OCI / OS. * integrate project repository cloning * override repository and framework locations * show previous states of directories & files -* split switch to Python step +* relay Python module name From 5a55cfba1692376ba86610566d59b0c4149f24b1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 22:13:57 +0200 Subject: [PATCH 294/392] env/step --- cd.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 70add07..a66889d 100644 --- a/cd.sh +++ b/cd.sh @@ -573,6 +573,9 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +STEP = ${CD_STEP} + + $(cd_echo CD_OS_ID CD_OS_VERSION) @@ -580,7 +583,14 @@ $(cd_echo CD_OPEN CD_SHUT) $(cd_echo CD_HORIZONTAL) -$(cd_echo CD_DOWN CD_SPLIT CD_UP) +$(cd_echo CD_SPLIT) + + +def step(*arguments): + STEP += 1 + print('${CD_DOWN}') + print('${CD_BOX_VERTICAL}', STEP, *arguments) + print('${CD_UP}', flush=True) " } From cdac55a90b78f9661b4c99dadf4469629940017c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 22:16:16 +0200 Subject: [PATCH 295/392] env/split --- cd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index a66889d..a5aee1a 100644 --- a/cd.sh +++ b/cd.sh @@ -583,7 +583,9 @@ $(cd_echo CD_OPEN CD_SHUT) $(cd_echo CD_HORIZONTAL) -$(cd_echo CD_SPLIT) + +def split(): + print('${CD_SPLIT}', flush=True) def step(*arguments): From 2eb03cf86304c65c205a64e37256c4457dd34bfb Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 4 Jun 2024 23:18:25 +0200 Subject: [PATCH 296/392] open,shut --- cd.sh | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cd.sh b/cd.sh index a5aee1a..b64ce20 100644 --- a/cd.sh +++ b/cd.sh @@ -573,15 +573,19 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +$(cd_echo CD_OS_ID CD_OS_VERSION) + STEP = ${CD_STEP} -$(cd_echo CD_OS_ID CD_OS_VERSION) +def open(*arguments): + print('${CD_OPEN}', end=str()) + print(*arguments, flush=True) -$(cd_echo CD_OPEN CD_SHUT) - -$(cd_echo CD_HORIZONTAL) +def shut(*arguments): + print('${CD_SHUT}', end=str()) + print(*arguments, flush=True) def split(): @@ -611,18 +615,11 @@ ${CD_GIT_CHILD} # functions -cd_box_open () { - echo "${CD_OPEN}${@}" -} -cd_box_shut () { - echo "${CD_SHUT}${@}" -} - cd_cat () { if [ -f "${1}" ] ; then - cd_box_open "${1}" + cd_open "${1}" cat "${1}" || exit - cd_box_shut "${1}" + cd_shut "${1}" fi } @@ -672,9 +669,9 @@ local command="${1}" cd_ls () { if [ -d "${1}" ] ; then - cd_box_open "${1}" + cd_open "${1}" ls -a -l "${1}" || exit - cd_box_shut "${1}" + cd_shut "${1}" fi } @@ -685,6 +682,10 @@ cd_mkdir () { fi } +cd_open () { + echo "${CD_OPEN}${@}" +} + cd_openssl () { local file="${1}" if [ -f "${file}" ] ; then @@ -714,6 +715,10 @@ shift fi } +cd_shut () { + echo "${CD_SHUT}${@}" +} + cd_split () { echo "${CD_SPLIT}" } From 4fc693a17ea48e89c160c6df076ffb2b172bb9ce Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:32:25 +0200 Subject: [PATCH 297/392] useless --- cmd/cd-clone-python.sh | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100755 cmd/cd-clone-python.sh diff --git a/cmd/cd-clone-python.sh b/cmd/cd-clone-python.sh deleted file mode 100755 index 52eb00e..0000000 --- a/cmd/cd-clone-python.sh +++ /dev/null @@ -1,15 +0,0 @@ -[ "${1}" ] && REPOSITORY_FULL="${1}" || exit -REPOSITORY_NAME="$(basename ${REPOSITORY_FULL})" - -REPOSITORY_TEMP="$(mktemp --directory)" - -git clone \ --- \ -"${GITHUB_SERVER_URL}/${REPOSITORY_FULL}" \ -"${REPOSITORY_TEMP}" - -mv "${REPOSITORY_TEMP}/${REPOSITORY_NAME}" \ -/usr/local/lib/python3.*/dist-packages/ - -rm --force --recursive \ -"${REPOSITORY_TEMP}" From 916b7a56cdebca4036a31ef1284190e7b2fc1ee8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:41:47 +0200 Subject: [PATCH 298/392] py/step --- cd.sh | 13 +++++-------- cd/__init__.py | 7 +++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index b64ce20..b88b6fd 100644 --- a/cd.sh +++ b/cd.sh @@ -573,9 +573,13 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ +STEP = ${CD_STEP} + $(cd_echo CD_OS_ID CD_OS_VERSION) -STEP = ${CD_STEP} +DOWN = \"${CD_DOWN}\" +UP = \"${CD_UP}\" +VERTICAL = \"${CD_BOX_VERTICAL}\" def open(*arguments): @@ -590,13 +594,6 @@ def shut(*arguments): def split(): print('${CD_SPLIT}', flush=True) - - -def step(*arguments): - STEP += 1 - print('${CD_DOWN}') - print('${CD_BOX_VERTICAL}', STEP, *arguments) - print('${CD_UP}', flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index 279a18f..d1c1653 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -107,3 +107,10 @@ def set_ssh(*arguments): if ssh_hosts: fs.write(known, ssh_hosts) os.chmod(known, 0o400) + + +def step(*arguments): + env.STEP += 1 + print(env.DOWN) + print(env.VERTICAL, env.STEP, *arguments) + print(env.UP, flush=True) From d6f00d69450c606b71313cb7d8532f91275fca3c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:45:41 +0200 Subject: [PATCH 299/392] py/split --- cd.sh | 8 +++----- cd/__init__.py | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index b88b6fd..3d94d0f 100644 --- a/cd.sh +++ b/cd.sh @@ -578,8 +578,10 @@ STEP = ${CD_STEP} $(cd_echo CD_OS_ID CD_OS_VERSION) DOWN = \"${CD_DOWN}\" -UP = \"${CD_UP}\" VERTICAL = \"${CD_BOX_VERTICAL}\" +UP = \"${CD_UP}\" + +SPLIT = \"${CD_SPLIT}\" def open(*arguments): @@ -590,10 +592,6 @@ def open(*arguments): def shut(*arguments): print('${CD_SHUT}', end=str()) print(*arguments, flush=True) - - -def split(): - print('${CD_SPLIT}', flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index d1c1653..82a2c1e 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -109,6 +109,10 @@ def set_ssh(*arguments): os.chmod(known, 0o400) +def split(): + print(env.SPLIT, flush=True) + + def step(*arguments): env.STEP += 1 print(env.DOWN) From 5c9f50edfa0bed7c6d0a78e0b600787450cb6536 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:54:36 +0200 Subject: [PATCH 300/392] vertical --- cd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 3d94d0f..4781d48 100644 --- a/cd.sh +++ b/cd.sh @@ -578,7 +578,7 @@ STEP = ${CD_STEP} $(cd_echo CD_OS_ID CD_OS_VERSION) DOWN = \"${CD_DOWN}\" -VERTICAL = \"${CD_BOX_VERTICAL}\" +VERTICAL = \"${CD_VERTICAL}\" UP = \"${CD_UP}\" SPLIT = \"${CD_SPLIT}\" @@ -722,7 +722,7 @@ cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ ${CD_DOWN} -${CD_BOX_VERTICAL} ${CD_STEP} ${@} +${CD_VERTICAL} ${CD_STEP} ${@} ${CD_UP} " } @@ -767,6 +767,7 @@ CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" +CD_VERTICAL="${CD_BOX_VERTICAL}" CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" From c1eaf978d7909a9885d93ad7bf7b7248bdd17000 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 11:55:25 +0200 Subject: [PATCH 301/392] useless --- cd/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index 82a2c1e..968ad16 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -90,7 +90,8 @@ def install_commands(path): def set_ssh(*arguments): ssh_key, ssh_hosts = arguments - ssh_type = projects.environment.get('CD_SSH_TYPE', 'ed25519') + # + ssh_type = 'ed25519' # home = os.path.expanduser('~') # From 27a9b419d9595164966a665043a4f38ee658dc30 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 12:45:54 +0200 Subject: [PATCH 302/392] open,shut --- cd.sh | 24 ++++++++---------------- cd/__init__.py | 20 +++++++++++++++----- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/cd.sh b/cd.sh index 4781d48..e0bbb65 100644 --- a/cd.sh +++ b/cd.sh @@ -575,23 +575,15 @@ cd_write_python_module () { cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ STEP = ${CD_STEP} + +$(cd_echo CD_DOWN CD_VERTICAL CD_UP) + +$(cd_echo CD_OPEN CD_SHUT) + +$(cd_echo CD_SPLIT) + + $(cd_echo CD_OS_ID CD_OS_VERSION) - -DOWN = \"${CD_DOWN}\" -VERTICAL = \"${CD_VERTICAL}\" -UP = \"${CD_UP}\" - -SPLIT = \"${CD_SPLIT}\" - - -def open(*arguments): - print('${CD_OPEN}', end=str()) - print(*arguments, flush=True) - - -def shut(*arguments): - print('${CD_SHUT}', end=str()) - print(*arguments, flush=True) " } diff --git a/cd/__init__.py b/cd/__init__.py index 968ad16..6bb0000 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -110,12 +110,22 @@ def set_ssh(*arguments): os.chmod(known, 0o400) +def open(*arguments): + print(env.CD_OPEN, end=str()) + print(*arguments, flush=True) + + +def shut(*arguments): + print(env.CD_SHUT, end=str()) + print(*arguments, flush=True) + + def split(): - print(env.SPLIT, flush=True) + print(env.CD_SPLIT, flush=True) def step(*arguments): - env.STEP += 1 - print(env.DOWN) - print(env.VERTICAL, env.STEP, *arguments) - print(env.UP, flush=True) + env.CD_STEP += 1 + print(env.CD_DOWN) + print(env.CD_VERTICAL, env.CD_STEP, *arguments) + print(env.CD_UP, flush=True) From c095fe57a216dee3601bb560e97cffa668c18820 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 12:47:00 +0200 Subject: [PATCH 303/392] fix --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index e0bbb65..626c577 100644 --- a/cd.sh +++ b/cd.sh @@ -573,7 +573,7 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ -STEP = ${CD_STEP} +CD_STEP = ${CD_STEP} $(cd_echo CD_DOWN CD_VERTICAL CD_UP) From 2c85bcc6bc0cc509630cac83337efe409ac6a4b7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 14:37:23 +0200 Subject: [PATCH 304/392] rejigger --- cd.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index 626c577..1e1dba4 100644 --- a/cd.sh +++ b/cd.sh @@ -575,13 +575,11 @@ cd_write_python_module () { cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ CD_STEP = ${CD_STEP} - -$(cd_echo CD_DOWN CD_VERTICAL CD_UP) - -$(cd_echo CD_OPEN CD_SHUT) - -$(cd_echo CD_SPLIT) - +$(cd_echo CD_OPEN) +$(cd_echo CD_DOWN) +$(cd_echo CD_VERTICAL CD_SPLIT) +$(cd_echo CD_UP) +$(cd_echo CD_SHUT) $(cd_echo CD_OS_ID CD_OS_VERSION) " From b6b8e03b507e82462b27a9f23207b9b1387d4841 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 14:46:56 +0200 Subject: [PATCH 305/392] splt --- cd.sh | 6 +++--- cd/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 1e1dba4..8a08afe 100644 --- a/cd.sh +++ b/cd.sh @@ -577,7 +577,7 @@ CD_STEP = ${CD_STEP} $(cd_echo CD_OPEN) $(cd_echo CD_DOWN) -$(cd_echo CD_VERTICAL CD_SPLIT) +$(cd_echo CD_VERTICAL CD_SPLT) $(cd_echo CD_UP) $(cd_echo CD_SHUT) @@ -705,7 +705,7 @@ cd_shut () { } cd_split () { - echo "${CD_SPLIT}" + echo "${CD_SPLT}" } cd_step () { @@ -760,7 +760,7 @@ CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" CD_VERTICAL="${CD_BOX_VERTICAL}" CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" -CD_SPLIT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" +CD_SPLT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" CD_UP="${CD_BOX_UP}${CD_HORIZONTAL}" # run diff --git a/cd/__init__.py b/cd/__init__.py index 6bb0000..97c2196 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -121,7 +121,7 @@ def shut(*arguments): def split(): - print(env.CD_SPLIT, flush=True) + print(env.CD_SPLT, flush=True) def step(*arguments): From 50b2fbfeef38e66db56a2b70b3876652ae074150 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 14:48:19 +0200 Subject: [PATCH 306/392] vert --- cd.sh | 6 +++--- cd/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 8a08afe..1d4b2c5 100644 --- a/cd.sh +++ b/cd.sh @@ -577,7 +577,7 @@ CD_STEP = ${CD_STEP} $(cd_echo CD_OPEN) $(cd_echo CD_DOWN) -$(cd_echo CD_VERTICAL CD_SPLT) +$(cd_echo CD_VERT CD_SPLT) $(cd_echo CD_UP) $(cd_echo CD_SHUT) @@ -712,7 +712,7 @@ cd_step () { CD_STEP=$((CD_STEP+1)) echo -n "\ ${CD_DOWN} -${CD_VERTICAL} ${CD_STEP} ${@} +${CD_VERT} ${CD_STEP} ${@} ${CD_UP} " } @@ -757,7 +757,7 @@ CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" -CD_VERTICAL="${CD_BOX_VERTICAL}" +CD_VERT="${CD_BOX_VERTICAL}" CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" CD_SPLT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" diff --git a/cd/__init__.py b/cd/__init__.py index 97c2196..f3ab569 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -127,5 +127,5 @@ def split(): def step(*arguments): env.CD_STEP += 1 print(env.CD_DOWN) - print(env.CD_VERTICAL, env.CD_STEP, *arguments) + print(env.CD_VERT, env.CD_STEP, *arguments) print(env.CD_UP, flush=True) From 4d61f043440691e03c9d5eebab46f4c02e57372d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 14:49:24 +0200 Subject: [PATCH 307/392] up --- cd.sh | 6 +++--- cd/__init__.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 1d4b2c5..5b78f97 100644 --- a/cd.sh +++ b/cd.sh @@ -578,7 +578,7 @@ CD_STEP = ${CD_STEP} $(cd_echo CD_OPEN) $(cd_echo CD_DOWN) $(cd_echo CD_VERT CD_SPLT) -$(cd_echo CD_UP) +$(cd_echo CD___UP) $(cd_echo CD_SHUT) $(cd_echo CD_OS_ID CD_OS_VERSION) @@ -713,7 +713,7 @@ cd_step () { echo -n "\ ${CD_DOWN} ${CD_VERT} ${CD_STEP} ${@} -${CD_UP} +${CD___UP} " } @@ -761,7 +761,7 @@ CD_VERT="${CD_BOX_VERTICAL}" CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" CD_SPLT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" -CD_UP="${CD_BOX_UP}${CD_HORIZONTAL}" +CD___UP="${CD_BOX_UP}${CD_HORIZONTAL}" # run cd_main "${@}" diff --git a/cd/__init__.py b/cd/__init__.py index f3ab569..c4cccff 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -128,4 +128,4 @@ def step(*arguments): env.CD_STEP += 1 print(env.CD_DOWN) print(env.CD_VERT, env.CD_STEP, *arguments) - print(env.CD_UP, flush=True) + print(env.CD___UP, flush=True) From 9fea2acbfd4f6b252b87589743355442adc28dcd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 14:50:13 +0200 Subject: [PATCH 308/392] rejigger --- cd.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 5b78f97..6b133ff 100644 --- a/cd.sh +++ b/cd.sh @@ -753,15 +753,14 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" -CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" -CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" - CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" -CD_VERT="${CD_BOX_VERTICAL}" +CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" +CD_VERT="${CD_BOX_VERTICAL}" CD_SPLT="${CD_BOX_RIGHT}${CD_HORIZONTAL}" CD___UP="${CD_BOX_UP}${CD_HORIZONTAL}" +CD_SHUT="${CD_BOX_UP}${CD_BOX_LEFT}" # run cd_main "${@}" From 0e585adc7cba49fccb99ed3f1984511f1b8016f2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 16:55:29 +0200 Subject: [PATCH 309/392] ++ --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 6b133ff..1c0574c 100644 --- a/cd.sh +++ b/cd.sh @@ -573,7 +573,7 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ -CD_STEP = ${CD_STEP} +CD_STEP = $((CD_STEP+1)) $(cd_echo CD_OPEN) $(cd_echo CD_DOWN) From d5e80084176901c5607dc81d08b05325438e7653 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 17:02:08 +0200 Subject: [PATCH 310/392] step --- cd.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 1c0574c..cdad2e8 100644 --- a/cd.sh +++ b/cd.sh @@ -573,15 +573,13 @@ ${CD_PYTHON_PACKAGES} cd_write_python_module () { cd_step "Write Python module" cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ -CD_STEP = $((CD_STEP+1)) - -$(cd_echo CD_OPEN) -$(cd_echo CD_DOWN) +$(cd_echo CD_OPEN CD_DOWN) $(cd_echo CD_VERT CD_SPLT) -$(cd_echo CD___UP) -$(cd_echo CD_SHUT) +$(cd_echo CD___UP CD_SHUT) $(cd_echo CD_OS_ID CD_OS_VERSION) + +CD_STEP = $((CD_STEP+1)) " } From 4e9a2f3804857a52b40bd5c780db0c01c33121f2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 5 Jun 2024 17:04:06 +0200 Subject: [PATCH 311/392] steps --- cd/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cd/__init__.py b/cd/__init__.py index c4cccff..840d848 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -76,6 +76,7 @@ def cd_synchronize(): def install_commands(path): + step('Install commands') user = '/usr/local/bin' for command in [ 'browse-workspace', @@ -89,6 +90,8 @@ def install_commands(path): def set_ssh(*arguments): + step('Set SSH') + # ssh_key, ssh_hosts = arguments # ssh_type = 'ed25519' From 0a1bb94e6c053dfd162f0a7a08d95f64d0d83717 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 6 Jun 2024 10:08:04 +0200 Subject: [PATCH 312/392] path --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index cdad2e8..bdfa8a3 100644 --- a/cd.sh +++ b/cd.sh @@ -591,7 +591,7 @@ local path echo -n "\ ${path} ↓ -${CD_GIT_CHILD} +${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD} " "${CD_PYTHON_ALIAS}" -m "${CD_GIT_CHILD}" "${@}" } From f0d5bd12b02a7ecd585437640e9932d090551eb3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 6 Jun 2024 10:17:02 +0200 Subject: [PATCH 313/392] browse --- cd/__init__.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 840d848..38a6672 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -13,18 +13,7 @@ project = Project(projects) def cd_browse_workspace(): - print(f'''\ -{project.root} -↓ -''', end=str()) - paths = [] - for directory, directories, files in os.walk(project.root): - for file in files: - absolute_path = os.path.join(directory, file) - relative_path = os.path.relpath(absolute_path, start=project.root) - paths.append(relative_path) - for path in sorted(paths): - print(path) + browse(project.root) def cd_build_project(): @@ -75,6 +64,19 @@ def cd_synchronize(): ) +def browse(root: str): + paths = [] + for directory, _, files in os.walk(root): + for file in files: + absolute_path = os.path.join(directory, file) + relative_path = os.path.relpath(absolute_path, start=root) + paths.append(relative_path) + open(path) + for path in sorted(paths): + print(path) + shut(path) + + def install_commands(path): step('Install commands') user = '/usr/local/bin' @@ -111,6 +113,8 @@ def set_ssh(*arguments): if ssh_hosts: fs.write(known, ssh_hosts) os.chmod(known, 0o400) + # + browse(home) def open(*arguments): From 60df30cb39faa444f56b36341a4f878504138480 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 6 Jun 2024 10:53:19 +0200 Subject: [PATCH 314/392] fix --- cd/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 38a6672..43e7573 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -71,10 +71,10 @@ def browse(root: str): absolute_path = os.path.join(directory, file) relative_path = os.path.relpath(absolute_path, start=root) paths.append(relative_path) - open(path) + open(root) for path in sorted(paths): print(path) - shut(path) + shut(root) def install_commands(path): From 587fe469eb10e31b443ab90d452c83e47f48e3b5 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 6 Jun 2024 11:36:06 +0200 Subject: [PATCH 315/392] fixes --- cd.sh | 4 +++- cd/__init__.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index bdfa8a3..c816f2a 100644 --- a/cd.sh +++ b/cd.sh @@ -545,7 +545,7 @@ local root local url cd_step "Install Python modules" root="$(mktemp --directory)" || exit - echo "${root}" + echo "→ ${root}" for repository in "${CD_GIT_CHILD}" "${CD_GIT_PARENT}" ; do cd_split url="${CD_PROJECTS_URL}/${repository}" @@ -567,6 +567,8 @@ ${CD_PYTHON_PACKAGES} || exit done cd_split + cd_ls "${CD_PYTHON_PACKAGES}" + cd_split cd_rm "${root}" } diff --git a/cd/__init__.py b/cd/__init__.py index 43e7573..5b608cf 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -114,7 +114,7 @@ def set_ssh(*arguments): fs.write(known, ssh_hosts) os.chmod(known, 0o400) # - browse(home) + browse(ssh) def open(*arguments): From b3b9a903757934b872dcbf8bc38d1a02849584d3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 6 Jun 2024 12:17:50 +0200 Subject: [PATCH 316/392] horizontal --- cd.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index c816f2a..5058593 100644 --- a/cd.sh +++ b/cd.sh @@ -731,7 +731,6 @@ local text="${2}" # constants CD_BOX_DOWN="╭" -CD_BOX_HORIZONTAL="─" CD_BOX_LEFT="╴" CD_BOX_RIGHT="╶" CD_BOX_UP="╰" @@ -753,7 +752,7 @@ CD_PM_APT="apt" CD_PM_DNF="dnf" CD_PM_PACMAN="pacman" -CD_HORIZONTAL="${CD_BOX_HORIZONTAL}╌╌┄┄┈┈" +CD_HORIZONTAL="────╌╌╌╌┄┄┄┄┈┈┈┈" CD_OPEN="${CD_BOX_DOWN}${CD_BOX_LEFT}" CD_DOWN="${CD_BOX_DOWN}${CD_HORIZONTAL}" From e03bd5484400bb900c2fea194897643507cee6e6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 6 Jun 2024 14:41:06 +0200 Subject: [PATCH 317/392] cat,known --- cd/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cd/__init__.py b/cd/__init__.py index 5b608cf..7970a1a 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -77,6 +77,12 @@ def browse(root: str): shut(root) +def cat(file: str): + open(file) + print(fs.read_file_text(file)) + shut(file) + + def install_commands(path): step('Install commands') user = '/usr/local/bin' @@ -113,6 +119,7 @@ def set_ssh(*arguments): if ssh_hosts: fs.write(known, ssh_hosts) os.chmod(known, 0o400) + cat(known) # browse(ssh) From 660140c0847d32a7c8112945594b1752fd793800 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 6 Jun 2024 16:01:59 +0200 Subject: [PATCH 318/392] rstrip --- cd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index 7970a1a..befcf35 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -79,7 +79,7 @@ def browse(root: str): def cat(file: str): open(file) - print(fs.read_file_text(file)) + print(fs.read_file_text(file).rstrip()) shut(file) From 04d9661def29d37f50fa3ca186e0db86ace0e26c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 7 Jun 2024 10:26:18 +0200 Subject: [PATCH 319/392] " --- cd/__init__.py | 70 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index befcf35..6b90987 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -6,7 +6,7 @@ import env from rwx import fs from rwx import ps -COMMANDS_PREFIX = 'cd-' +COMMANDS_PREFIX = "cd-" projects = Projects(os.environ) project = Project(projects) @@ -17,8 +17,8 @@ def cd_browse_workspace(): def cd_build_project(): - for extension in ['py', 'sh']: - path = os.path.join(project.root, f'build.{extension}') + for extension in ["py", "sh"]: + path = os.path.join(project.root, f"build.{extension}") if os.path.exists(path): ps.run(path) break @@ -27,14 +27,14 @@ def cd_build_project(): def cd_clone_branch(): - print(f'''\ + print(f"""\ {project.url} ↓ -''', end=str(), flush=True) - ps.run('git', - 'clone', - '--branch', project.branch, - '--', +""", end=str(), flush=True) + ps.run("git", + "clone", + "--branch", project.branch, + "--", project.url, project.root, ) @@ -42,25 +42,25 @@ def cd_clone_branch(): def cd_list_environment(): for variable, value in sorted(projects.environment.items()): - print(variable, '=', value) + print(variable, "=", value) def cd_synchronize(): - host = 'rwx.work' - source = 'out' - user = 'cd' + host = "rwx.work" + source = "out" + user = "cd" # root = os.sep.join([str(), user, project.branch, projects.group, project.name]) # - target = f'{user}@{host}:{root}' - ps.run('rsync', - '--archive', - '--delete-before', - '--verbose', - f'{source}/', - f'{target}/', - '--dry-run', + target = f"{user}@{host}:{root}" + ps.run("rsync", + "--archive", + "--delete-before", + "--verbose", + f"{source}/", + f"{target}/", + "--dry-run", ) @@ -84,38 +84,38 @@ def cat(file: str): def install_commands(path): - step('Install commands') - user = '/usr/local/bin' + step("Install commands") + user = "/usr/local/bin" for command in [ - 'browse-workspace', - 'build-project', - 'clone-branch', - 'list-environment', - 'synchronize', + "browse-workspace", + "build-project", + "clone-branch", + "list-environment", + "synchronize", ]: print(command) - os.symlink(path, os.path.join(user, f'{COMMANDS_PREFIX}{command}')) + os.symlink(path, os.path.join(user, f"{COMMANDS_PREFIX}{command}")) def set_ssh(*arguments): - step('Set SSH') + step("Set SSH") # ssh_key, ssh_hosts = arguments # - ssh_type = 'ed25519' + ssh_type = "ed25519" # - home = os.path.expanduser('~') + home = os.path.expanduser("~") # - ssh = os.path.join(home, '.ssh') + ssh = os.path.join(home, ".ssh") os.makedirs(ssh, exist_ok=True) os.chmod(ssh, 0o700) # - key = os.path.join(ssh, f'id_{ssh_type}') + key = os.path.join(ssh, f"id_{ssh_type}") if ssh_key: fs.write(key, ssh_key) os.chmod(key, 0o400) # - known = os.path.join(ssh, 'known_hosts') + known = os.path.join(ssh, "known_hosts") if ssh_hosts: fs.write(known, ssh_hosts) os.chmod(known, 0o400) From 9421afcedbe8b14bc57d72fd8187d3ff7ee5e48e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 7 Jun 2024 10:36:24 +0200 Subject: [PATCH 320/392] "" --- cd/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 6b90987..4ea730e 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -30,7 +30,7 @@ def cd_clone_branch(): print(f"""\ {project.url} ↓ -""", end=str(), flush=True) +""", end="", flush=True) ps.run("git", "clone", "--branch", project.branch, @@ -50,7 +50,7 @@ def cd_synchronize(): source = "out" user = "cd" # - root = os.sep.join([str(), + root = os.sep.join(["", user, project.branch, projects.group, project.name]) # target = f"{user}@{host}:{root}" @@ -125,12 +125,12 @@ def set_ssh(*arguments): def open(*arguments): - print(env.CD_OPEN, end=str()) + print(env.CD_OPEN, end="") print(*arguments, flush=True) def shut(*arguments): - print(env.CD_SHUT, end=str()) + print(env.CD_SHUT, end="") print(*arguments, flush=True) From 1813a03803a5687aad4adb05bc2f5477633b30c2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 7 Jun 2024 15:20:51 +0200 Subject: [PATCH 321/392] unused --- cd.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/cd.sh b/cd.sh index 5058593..80e40d9 100644 --- a/cd.sh +++ b/cd.sh @@ -373,7 +373,6 @@ Acquire::https::Verify-Peer False; } cd_set_packages_repositories () { -local expression local file cd_step "Set packages repositories" case "${CD_OS_ID}" in From 013d3bb8f387b6abda68c2afba3821ef70469531 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 7 Jun 2024 15:25:37 +0200 Subject: [PATCH 322/392] || --- cd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 80e40d9..13141fd 100644 --- a/cd.sh +++ b/cd.sh @@ -442,7 +442,7 @@ cd_list_working_directory () { } cd_set_https_verification_off () { - if [ "${CD_CA}" -o "${CD_PM}" = "${CD_PM_APT}" ] ; then + if [ "${CD_CA}" ] || [ "${CD_PM}" = "${CD_PM_APT}" ] ; then cd_step "Set HTTPS verification off" cd_mkdir "$(dirname "${CD_PM_HTTPS_PATH}")" cd_write "${CD_PM_HTTPS_PATH}" "${CD_PM_HTTPS_TEXT}" From 1a6241033fd2fe503abc1181c2274af3d46fc468 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 7 Jun 2024 15:45:18 +0200 Subject: [PATCH 323/392] =?UTF-8?q?echo=20-n=20=E2=86=92=20printf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 13141fd..833a7b9 100644 --- a/cd.sh +++ b/cd.sh @@ -548,7 +548,7 @@ local url for repository in "${CD_GIT_CHILD}" "${CD_GIT_PARENT}" ; do cd_split url="${CD_PROJECTS_URL}/${repository}" - echo -n "\ + printf "\ ${url} ↓ " @@ -556,7 +556,7 @@ ${url} "${url}" "${root}/${repository}" \ || exit path="${root}/${repository}/${repository}" - echo -n "\ + printf "\ ${path} ↓ ${CD_PYTHON_PACKAGES} @@ -589,7 +589,7 @@ local path cd_step "Switch to Python" # path="$(realpath "${0}")" - echo -n "\ + printf "\ ${path} ↓ ${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD} @@ -623,7 +623,7 @@ cd_error_ci () { cd_error_os () { local variable="${1}" - echo -n "× OS: " + printf "× OS: " cd_echo "${variable}" exit ${CD_ERROR_OS} } @@ -709,7 +709,7 @@ cd_split () { cd_step () { CD_STEP=$((CD_STEP+1)) - echo -n "\ + printf "\ ${CD_DOWN} ${CD_VERT} ${CD_STEP} ${@} ${CD___UP} @@ -722,7 +722,7 @@ local text="${2}" if [ "${file}" ] ; then [ -f "${file}" ] && cd_cat "${file}" echo "→ ${1}" - echo -n "${text}" > "${file}" || exit + printf "${text}" > "${file}" || exit cd_cat "${file}" fi } From 6a93b10cf8cf5c80a724f71120d5f68c7cf29215 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 11:56:38 +0200 Subject: [PATCH 324/392] echo --- cd.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/cd.sh b/cd.sh index 833a7b9..a59aa80 100644 --- a/cd.sh +++ b/cd.sh @@ -548,19 +548,17 @@ local url for repository in "${CD_GIT_CHILD}" "${CD_GIT_PARENT}" ; do cd_split url="${CD_PROJECTS_URL}/${repository}" - printf "\ + echo "\ ${url} -↓ -" +↓" git clone \ "${url}" "${root}/${repository}" \ || exit path="${root}/${repository}/${repository}" - printf "\ + echo "\ ${path} ↓ -${CD_PYTHON_PACKAGES} -" +${CD_PYTHON_PACKAGES}" cp --recursive \ "${path}" "${CD_PYTHON_PACKAGES}" \ || exit @@ -589,11 +587,10 @@ local path cd_step "Switch to Python" # path="$(realpath "${0}")" - printf "\ + echo "\ ${path} ↓ -${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD} -" +${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD}" "${CD_PYTHON_ALIAS}" -m "${CD_GIT_CHILD}" "${@}" } @@ -709,11 +706,10 @@ cd_split () { cd_step () { CD_STEP=$((CD_STEP+1)) - printf "\ + echo "\ ${CD_DOWN} ${CD_VERT} ${CD_STEP} ${@} -${CD___UP} -" +${CD___UP}" } cd_write () { @@ -722,7 +718,7 @@ local text="${2}" if [ "${file}" ] ; then [ -f "${file}" ] && cd_cat "${file}" echo "→ ${1}" - printf "${text}" > "${file}" || exit + printf "%s" "${text}" > "${file}" || exit cd_cat "${file}" fi } From be0f461304f9d6af6c449624a94838a4c42e5f31 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:05:37 +0200 Subject: [PATCH 325/392] cd_write --- cd.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index a59aa80..7c6b261 100644 --- a/cd.sh +++ b/cd.sh @@ -713,13 +713,14 @@ ${CD___UP}" } cd_write () { -local file="${1}" -local text="${2}" - if [ "${file}" ] ; then - [ -f "${file}" ] && cd_cat "${file}" - echo "→ ${1}" - printf "%s" "${text}" > "${file}" || exit - cd_cat "${file}" + cd_write__file="${1}" + cd_write__text="${2}" + # + if [ "${cd_write__file}" ] ; then + [ -f "${cd_write__file}" ] && cd_cat "${cd_write__file}" + echo "→ ${cd_write__file}" + printf "%s" "${cd_write__text}" > "${cd_write__file}" || exit + cd_cat "${cd_write__file}" fi } From 891d3a4067a9946b056e54e306ee0d1a8335cd37 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:14:52 +0200 Subject: [PATCH 326/392] =?UTF-8?q?${@}=20=E2=86=92=20${*}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 7c6b261..9ae374a 100644 --- a/cd.sh +++ b/cd.sh @@ -664,7 +664,7 @@ cd_mkdir () { } cd_open () { - echo "${CD_OPEN}${@}" + echo "${CD_OPEN}${*}" } cd_openssl () { @@ -697,7 +697,7 @@ shift } cd_shut () { - echo "${CD_SHUT}${@}" + echo "${CD_SHUT}${*}" } cd_split () { @@ -708,7 +708,7 @@ cd_step () { CD_STEP=$((CD_STEP+1)) echo "\ ${CD_DOWN} -${CD_VERT} ${CD_STEP} ${@} +${CD_VERT} ${CD_STEP} ${*} ${CD___UP}" } From 99af49e1a846313146e3687f7428a1ad3fee2274 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:18:39 +0200 Subject: [PATCH 327/392] cd_openssl --- cd.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 9ae374a..ecb9f92 100644 --- a/cd.sh +++ b/cd.sh @@ -668,9 +668,12 @@ cd_open () { } cd_openssl () { -local file="${1}" - if [ -f "${file}" ] ; then - openssl x509 -noout -text -in "${file}" || exit + cd_openssl__file="${1}" + if [ -f "${cd_openssl__file}" ] ; then + openssl x509 \ + -in "${cd_openssl__file}" \ + -noout -text \ + || exit fi } From 1100cf423433f7e6a3a5c3bca7f579244c4b8118 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:32:21 +0200 Subject: [PATCH 328/392] cd_sed --- cd.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index ecb9f92..561dc0e 100644 --- a/cd.sh +++ b/cd.sh @@ -686,14 +686,14 @@ local path="${1}" } cd_sed () { -local expression -local file="${1}" -shift - if [ -f "${file}" ] ; then - cd_cat "${file}" - for expression in "${@}" ; do - sed --in-place "s${expression}g" "${file}" \ - && cd_cat "${file}" \ + cd_sed__file="${1}" + shift + # + if [ -f "${cd_sed__file}" ] ; then + cd_cat "${cd_sed__file}" + for cd_sed__regex in "${@}" ; do + sed --in-place "s${cd_sed__regex}g" "${cd_sed__file}" \ + && cd_cat "${cd_sed__file}" \ || exit done fi From 571497c5cfa4ac612e5bca06f2c6b39c8412754e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:35:51 +0200 Subject: [PATCH 329/392] cd_rm --- cd.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cd.sh b/cd.sh index 561dc0e..9445890 100644 --- a/cd.sh +++ b/cd.sh @@ -678,17 +678,16 @@ cd_openssl () { } cd_rm () { -local path="${1}" - if [ -e "${path}" ] ; then - echo "← ${path}" - rm -r "${path}" || exit + cd_rm__path="${1}" + if [ -e "${cd_rm__path}" ] ; then + echo "← ${cd_rm__path}" + rm -r "${cd_rm__path}" || exit fi } cd_sed () { cd_sed__file="${1}" shift - # if [ -f "${cd_sed__file}" ] ; then cd_cat "${cd_sed__file}" for cd_sed__regex in "${@}" ; do @@ -718,7 +717,6 @@ ${CD___UP}" cd_write () { cd_write__file="${1}" cd_write__text="${2}" - # if [ "${cd_write__file}" ] ; then [ -f "${cd_write__file}" ] && cd_cat "${cd_write__file}" echo "→ ${cd_write__file}" From 953fb8103210ec508f4b5a20bad5e9ed8088bf71 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:37:06 +0200 Subject: [PATCH 330/392] cd_mkdir --- cd.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index 9445890..1fda11b 100644 --- a/cd.sh +++ b/cd.sh @@ -657,9 +657,10 @@ cd_ls () { } cd_mkdir () { - if [ "${1}" ] ; then - echo "→ ${1}" - mkdir --parents "${1}" || exit + cd_mkdir__path="${1}" + if [ "${cd_mkdir__path}" ] ; then + echo "→ ${cd_mkdir__path}" + mkdir --parents "${cd_mkdir__path}" || exit fi } From ff58a3b3974865e66cead024c7f4d059e52362ec Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:42:10 +0200 Subject: [PATCH 331/392] cd_ls --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 1fda11b..d1c14ad 100644 --- a/cd.sh +++ b/cd.sh @@ -649,10 +649,11 @@ local command="${1}" } cd_ls () { - if [ -d "${1}" ] ; then - cd_open "${1}" - ls -a -l "${1}" || exit - cd_shut "${1}" + cd_ls__path="${1}" + if [ "${cd_ls__path}" ] ; then + cd_open "${cd_ls__path}" + ls -a -l "${cd_ls__path}" || exit + cd_shut "${cd_ls__path}" fi } From 5217951380e41b39422cf545e68445e064d05b0d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 12:45:43 +0200 Subject: [PATCH 332/392] cd_ln_python --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index d1c14ad..804d963 100644 --- a/cd.sh +++ b/cd.sh @@ -641,10 +641,11 @@ cd_install_package () { } cd_ln_python () { -local command="${1}" - if [ "${command}" ] ; then - echo "→ ${CD_PYTHON_ALIAS} → ${command}" - ln -f -s "${command}" "/usr/bin/${CD_PYTHON_ALIAS}" || exit + cd_ln_python__command="${1}" + if [ "${cd_ln_python__command}" ] ; then + echo "→ ${CD_PYTHON_ALIAS} → ${cd_ln_python__command}" + ln -f -s "${cd_ln_python__command}" "/usr/bin/${CD_PYTHON_ALIAS}" \ + || exit fi } From 58262405bfc57fa96b7a10ae320de87b2a9cdd4b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 13:21:17 +0200 Subject: [PATCH 333/392] cd_install_package --- cd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 804d963..8c7e9c9 100644 --- a/cd.sh +++ b/cd.sh @@ -635,8 +635,9 @@ local variable="${1}" } cd_install_package () { - if [ "${1}" ] ; then - ${CD_PM_INSTALL} "${1}" || exit + cd_install_package__name="${1}" + if [ "${cd_install_package__name}" ] ; then + ${CD_PM_INSTALL} "${cd_install_package__name}" || exit fi } From 5e8dd6fec210315d4fb20e7c4d4ce38c155fea86 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 13:24:43 +0200 Subject: [PATCH 334/392] cd_grep_os --- cd.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 8c7e9c9..bb50c68 100644 --- a/cd.sh +++ b/cd.sh @@ -626,10 +626,10 @@ local variable="${1}" } cd_grep_os () { -local variable="${1}" - if [ "${variable}" ] ; then - grep "^${variable}=" "/etc/os-release" \ - | sed "s|^${variable}=||" \ + cd_grep_os__variable="${1}" + if [ "${cd_grep_os__variable}" ] ; then + grep "^${cd_grep_os__variable}=" "/etc/os-release" \ + | sed "s|^${cd_grep_os__variable}=||" \ | sed "s|^\"\(.*\)\"$|\1|" fi } From d786c87a789d784294d09a05f074672562faa54f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 16:08:06 +0200 Subject: [PATCH 335/392] cd_error_ --- cd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index bb50c68..e88fcac 100644 --- a/cd.sh +++ b/cd.sh @@ -614,14 +614,14 @@ local name } cd_error_ci () { - echo "× CI: ${1}" + echo "× CI: ${*}" exit ${CD_ERROR_CI} } cd_error_os () { -local variable="${1}" + cd_error_os__variable="${1}" printf "× OS: " - cd_echo "${variable}" + cd_echo "${cd_error_os__variable}" exit ${CD_ERROR_OS} } From a8be6fdf648b510df84b2c95d3113f5e7c18b182 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 16:09:18 +0200 Subject: [PATCH 336/392] cd_echo --- cd.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cd.sh b/cd.sh index e88fcac..f15b989 100644 --- a/cd.sh +++ b/cd.sh @@ -605,10 +605,9 @@ cd_cat () { } cd_echo () { -local name if [ "${1}" ] ; then - for name in "${@}" ; do - eval "echo ${name} = \\\"\${${name}}\\\"" + for cd_echo__name in "${@}" ; do + eval "echo ${cd_echo__name} = \\\"\${${cd_echo__name}}\\\"" done fi } From 17d22283f8bff393e91ff662a7f46147c468eb86 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 16:10:45 +0200 Subject: [PATCH 337/392] cd_cat --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index f15b989..5bec963 100644 --- a/cd.sh +++ b/cd.sh @@ -597,10 +597,11 @@ ${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD}" # functions cd_cat () { - if [ -f "${1}" ] ; then - cd_open "${1}" - cat "${1}" || exit - cd_shut "${1}" + cd_cat__file="${1}" + if [ "${cd_cat__file}" ] ; then + cd_open "${cd_cat__file}" + cat "${cd_cat__file}" || exit + cd_shut "${cd_cat__file}" fi } From 2a19db986c55bcef909126d3c13999f9ded8dd4c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 16:21:46 +0200 Subject: [PATCH 338/392] cd_path --- cd.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cd.sh b/cd.sh index 5bec963..b12c1e7 100644 --- a/cd.sh +++ b/cd.sh @@ -40,6 +40,9 @@ cd_main () { cd_set_environment_variables () { cd_step "Set environment variables" + # set path + CD_PATH="$(realpath "${0}")" + cd_echo "CD_PATH" # set operating system id CD_OS_ID="$(cd_grep_os ID)" case "${CD_OS_ID}" in @@ -105,6 +108,7 @@ cd_set_environment_variables () { esac ;; esac + cd_split cd_echo "CD_OS_ID" "CD_OS_VERSION" # universal CD_DNS_FILE="/etc/resolv.conf" @@ -583,12 +587,9 @@ CD_STEP = $((CD_STEP+1)) } cd_switch_to_python () { -local path cd_step "Switch to Python" - # - path="$(realpath "${0}")" echo "\ -${path} +${CD_PATH} ↓ ${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD}" "${CD_PYTHON_ALIAS}" -m "${CD_GIT_CHILD}" "${@}" From 5fdf986cde7dd660651e6dae00d684c11a99bd19 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 16:39:44 +0200 Subject: [PATCH 339/392] cd_write_ca_certificates --- cd.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cd.sh b/cd.sh index b12c1e7..fe65ea1 100644 --- a/cd.sh +++ b/cd.sh @@ -480,20 +480,22 @@ cd_install_ca_certificates () { } cd_write_ca_certificates () { -local index -local path -local text cd_step "Write CA certificates" cd_mkdir "${CD_CA_ROOT}" - index=1 - eval "text=\"\${CD_CA_${index}}\"" - while [ "${text}" ] ; do - path="${CD_CA_ROOT}/${index}.crt" + cd_write_ca_certificates__index=1 + eval "cd_write_ca_certificates__text=\ +\"\${CD_CA_${cd_write_ca_certificates__index}}\"" + while [ "${cd_write_ca_certificates__text}" ] ; do + cd_write_ca_certificates__path="\ +${CD_CA_ROOT}/${cd_write_ca_certificates__index}.crt" cd_split - cd_write "${path}" "${text}" - cd_openssl "${path}" - index=$((index+1)) - eval "text=\"\${CD_CA_${index}}\"" + cd_write \ + "${cd_write_ca_certificates__path}" \ + "${cd_write_ca_certificates__text}" + cd_openssl "${cd_write_ca_certificates__path}" + cd_write_ca_certificates__index=$((cd_write_ca_certificates__index+1)) + eval "cd_write_ca_certificates__text=\ +\"\${CD_CA_${cd_write_ca_certificates__index}}\"" done } From 68c4444367ee27d9d62792af8f495c3b4d2c4108 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 17:15:53 +0200 Subject: [PATCH 340/392] cd_install_python_modules --- cd.sh | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/cd.sh b/cd.sh index fe65ea1..8823326 100644 --- a/cd.sh +++ b/cd.sh @@ -544,35 +544,38 @@ cd_clean_packages_cache () { } cd_install_python_modules () { -local path -local repository -local root -local url cd_step "Install Python modules" - root="$(mktemp --directory)" || exit - echo "→ ${root}" - for repository in "${CD_GIT_CHILD}" "${CD_GIT_PARENT}" ; do + cd_install_python_modules__root="$(mktemp --directory)" || exit + echo "→ ${cd_install_python_modules__root}" + for cd_install_python_modules__repository \ + in "${CD_GIT_CHILD}" "${CD_GIT_PARENT}" ; do cd_split - url="${CD_PROJECTS_URL}/${repository}" + cd_install_python_modules__url="\ +${CD_PROJECTS_URL}/${cd_install_python_modules__repository}" echo "\ -${url} +${cd_install_python_modules__url} ↓" git clone \ - "${url}" "${root}/${repository}" \ + "${cd_install_python_modules__url}" \ + "${cd_install_python_modules__root}\ +/${cd_install_python_modules__repository}" \ || exit - path="${root}/${repository}/${repository}" + cd_install_python_modules__path="\ +${cd_install_python_modules__root}\ +/${cd_install_python_modules__repository}\ +/${cd_install_python_modules__repository}" echo "\ -${path} +${cd_install_python_modules__path} ↓ ${CD_PYTHON_PACKAGES}" cp --recursive \ - "${path}" "${CD_PYTHON_PACKAGES}" \ + "${cd_install_python_modules__path}" "${CD_PYTHON_PACKAGES}" \ || exit done cd_split cd_ls "${CD_PYTHON_PACKAGES}" cd_split - cd_rm "${root}" + cd_rm "${cd_install_python_modules__root}" } cd_write_python_module () { From d2f060b6a151a7a3dc93354b0607c08158eaeeed Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 17:20:13 +0200 Subject: [PATCH 341/392] cd_set_dns_resolving --- cd.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cd.sh b/cd.sh index 8823326..eaba5d2 100644 --- a/cd.sh +++ b/cd.sh @@ -454,14 +454,13 @@ cd_set_https_verification_off () { } cd_set_dns_resolving () { -local server -local text="" cd_step "Set DNS resolving" - for server in ${CD_DNS} ; do - text="${text}nameserver ${server} + for cd_set_dns_resolving__server in ${CD_DNS} ; do + cd_set_dns_resolving__text="${cd_set_dns_resolving__text}\ +nameserver ${cd_set_dns_resolving__server} " done - cd_write "${CD_DNS_FILE}" "${text}" + cd_write "${CD_DNS_FILE}" "${cd_set_dns_resolving__text}" } cd_update_packages_catalog () { From 3c16e68d91d102eed23a3fa1b8949013e4c40da1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 17:28:38 +0200 Subject: [PATCH 342/392] cd_set_packages_repositories --- cd.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/cd.sh b/cd.sh index eaba5d2..65571c1 100644 --- a/cd.sh +++ b/cd.sh @@ -377,29 +377,30 @@ Acquire::https::Verify-Peer False; } cd_set_packages_repositories () { -local file cd_step "Set packages repositories" case "${CD_OS_ID}" in "${CD_OS_ALMA}") case "${CD_OS_VERSION}" in - "8") file="/etc/yum.repos.d/almalinux.repo" ;; - "9") file="/etc/yum.repos.d/almalinux-baseos.repo" ;; + "8") \ +cd_set_packages_repositories__file="/etc/yum.repos.d/almalinux.repo" ;; + "9") \ +cd_set_packages_repositories__file="/etc/yum.repos.d/almalinux-baseos.repo" ;; esac - cd_sed "${file}" \ + cd_sed "${cd_set_packages_repositories__file}" \ "|^mirrorlist|# mirrorlist|" \ "|${CD_URL_DEFAULT}|${CD_URL_CHOSEN}|" \ "|^# baseurl|baseurl|" ;; "${CD_OS_ALPINE}") - file="/etc/apk/repositories" - cd_write "${file}" "\ + cd_set_packages_repositories__file="/etc/apk/repositories" + cd_write "${cd_set_packages_repositories__file}" "\ ${CD_URL_CHOSEN}/v${CD_OS_VERSION}/main ${CD_URL_CHOSEN}/v${CD_OS_VERSION}/community " ;; "${CD_OS_DEBIAN}") - file="/etc/apt/sources.list" - cd_write "${file}" "\ + cd_set_packages_repositories__file="/etc/apt/sources.list" + cd_write "${cd_set_packages_repositories__file}" "\ deb ${CD_URL_CHOSEN} ${CD_OS_VERSION} main deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-backports main deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-updates main @@ -408,17 +409,19 @@ deb ${CD_URL_CHOSEN}-security ${CD_OS_VERSION}-security main ;; "${CD_OS_ROCKY}") case "${CD_OS_VERSION}" in - "8") file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; - "9") file="/etc/yum.repos.d/rocky.repo" ;; + "8") \ +cd_set_packages_repositories__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; + "9") \ +cd_set_packages_repositories__file="/etc/yum.repos.d/rocky.repo" ;; esac - cd_sed "${file}" \ + cd_sed "${cd_set_packages_repositories__file}" \ "|^mirrorlist|# mirrorlist|" \ "|${CD_URL_DEFAULT}|${CD_URL_CHOSEN}|" \ "|^#baseurl|baseurl|" ;; "${CD_OS_UBUNTU}") - file="/etc/apt/sources.list" - cd_write "${file}" "\ + cd_set_packages_repositories__file="/etc/apt/sources.list" + cd_write "${cd_set_packages_repositories__file}" "\ deb ${CD_URL_CHOSEN} ${CD_OS_VERSION} main deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-backports main deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-updates main From d73dd66251cfac6a6cbf681f5b6e09b973946b70 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 17:41:57 +0200 Subject: [PATCH 343/392] cd_project_url --- cd.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 65571c1..470a666 100644 --- a/cd.sh +++ b/cd.sh @@ -359,7 +359,6 @@ Acquire::https::Verify-Peer False; [ "${CD_PROJECT_BRANCH}" ] || cd_error_ci "CD_PROJECT_BRANCH" # CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" - CD_PROJECT_URL="${CD_PROJECTS_URL}/${CD_PROJECT_NAME}" # cd_split cd_echo "CD_CA" @@ -367,7 +366,7 @@ Acquire::https::Verify-Peer False; cd_echo "CD_SERVER_URL" \ "CD_PROJECTS_GROUP" "CD_PROJECT_NAME" "CD_PROJECT_BRANCH" cd_split - cd_echo "CD_PROJECTS_URL" "CD_PROJECT_URL" + cd_echo "CD_PROJECTS_URL" # TODO move to Python case "${CD_PM}" in "${CD_PM_APK}"|"${CD_PM_APT}") CD_PKG_SSH="openssh-client" ;; From c5852824a360099d302f12b5cf09b1aebe8f8b32 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 18:11:41 +0200 Subject: [PATCH 344/392] -n --- cd.sh | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/cd.sh b/cd.sh index 470a666..9496890 100644 --- a/cd.sh +++ b/cd.sh @@ -1,11 +1,11 @@ #! /usr/bin/env sh # defaults -[ "${CD_DNS}" ] || CD_DNS="\ +[ -n "${CD_DNS}" ] || CD_DNS="\ 9.9.9.9 \ " -[ "${CD_GIT_CHILD}" ] || CD_GIT_CHILD="cd" -[ "${CD_GIT_PARENT}" ] || CD_GIT_PARENT="rwx" +[ -n "${CD_GIT_CHILD}" ] || CD_GIT_CHILD="cd" +[ -n "${CD_GIT_PARENT}" ] || CD_GIT_PARENT="rwx" # main cd_main () { @@ -260,28 +260,28 @@ Acquire::https::Verify-Peer False; CD_URL_CHOSEN="${CD_URL_DEFAULT}" case "${CD_OS_ID}" in "${CD_OS_ALMA}") - [ "${CD_URL_ALMA}" ] && CD_URL_CHOSEN="${CD_URL_ALMA}" + [ -n "${CD_URL_ALMA}" ] && CD_URL_CHOSEN="${CD_URL_ALMA}" ;; "${CD_OS_ALPINE}") - [ "${CD_URL_ALPINE}" ] && CD_URL_CHOSEN="${CD_URL_ALPINE}" + [ -n "${CD_URL_ALPINE}" ] && CD_URL_CHOSEN="${CD_URL_ALPINE}" ;; "${CD_OS_ARCH}") - [ "${CD_URL_ARCH}" ] && CD_URL_CHOSEN="${CD_URL_ARCH}" + [ -n "${CD_URL_ARCH}" ] && CD_URL_CHOSEN="${CD_URL_ARCH}" ;; "${CD_OS_DEBIAN}") - [ "${CD_URL_DEBIAN}" ] && CD_URL_CHOSEN="${CD_URL_DEBIAN}" \ + [ -n "${CD_URL_DEBIAN}" ] && CD_URL_CHOSEN="${CD_URL_DEBIAN}" \ || CD_URL_CHOSEN="https://deb.debian.org/debian" ;; "${CD_OS_FEDORA}") - [ "${CD_URL_FEDORA}" ] && CD_URL_CHOSEN="${CD_URL_FEDORA}" \ + [ -n "${CD_URL_FEDORA}" ] && CD_URL_CHOSEN="${CD_URL_FEDORA}" \ || CD_URL_CHOSEN="https://rpmfind.net/linux/fedora/linux/releases" ;; "${CD_OS_ROCKY}") - [ "${CD_URL_ROCKY}" ] && CD_URL_CHOSEN="${CD_URL_ROCKY}" \ + [ -n "${CD_URL_ROCKY}" ] && CD_URL_CHOSEN="${CD_URL_ROCKY}" \ || CD_URL_CHOSEN="https://dl.rockylinux.org/\$contentdir" ;; "${CD_OS_UBUNTU}") - [ "${CD_URL_UBUNTU}" ] && CD_URL_CHOSEN="${CD_URL_UBUNTU}" \ + [ -n "${CD_URL_UBUNTU}" ] && CD_URL_CHOSEN="${CD_URL_UBUNTU}" \ || CD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" ;; esac @@ -335,15 +335,15 @@ Acquire::https::Verify-Peer False; cd_split cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" # variables - [ "${CD_CA_1}" ] && CD_CA=true + [ -n "${CD_CA_1}" ] && CD_CA=true # continuous integration platform - if [ "${GITHUB_ACTIONS}" ] ; then + if [ -n "${GITHUB_ACTIONS}" ] ; then # github → gitea → forgejo CD_SERVER_URL="${GITHUB_SERVER_URL}" CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" - elif [ "${GITLAB_CI}" ] ; then + elif [ -n "${GITLAB_CI}" ] ; then # gitlab CD_SERVER_URL="${CI_SERVER_URL}" CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" @@ -353,10 +353,10 @@ Acquire::https::Verify-Peer False; # unsupported cd_error_ci "ø" fi - [ "${CD_SERVER_URL}" ] || cd_error_ci "CD_SERVER_URL" - [ "${CD_PROJECTS_GROUP}" ] || cd_error_ci "CD_PROJECTS_GROUP" - [ "${CD_PROJECT_NAME}" ] || cd_error_ci "CD_PROJECT_NAME" - [ "${CD_PROJECT_BRANCH}" ] || cd_error_ci "CD_PROJECT_BRANCH" + [ -n "${CD_SERVER_URL}" ] || cd_error_ci "CD_SERVER_URL" + [ -n "${CD_PROJECTS_GROUP}" ] || cd_error_ci "CD_PROJECTS_GROUP" + [ -n "${CD_PROJECT_NAME}" ] || cd_error_ci "CD_PROJECT_NAME" + [ -n "${CD_PROJECT_BRANCH}" ] || cd_error_ci "CD_PROJECT_BRANCH" # CD_PROJECTS_URL="${CD_SERVER_URL}/${CD_PROJECTS_GROUP}" # @@ -448,7 +448,7 @@ cd_list_working_directory () { } cd_set_https_verification_off () { - if [ "${CD_CA}" ] || [ "${CD_PM}" = "${CD_PM_APT}" ] ; then + if [ -n "${CD_CA}" ] || [ "${CD_PM}" = "${CD_PM_APT}" ] ; then cd_step "Set HTTPS verification off" cd_mkdir "$(dirname "${CD_PM_HTTPS_PATH}")" cd_write "${CD_PM_HTTPS_PATH}" "${CD_PM_HTTPS_TEXT}" @@ -486,7 +486,7 @@ cd_write_ca_certificates () { cd_write_ca_certificates__index=1 eval "cd_write_ca_certificates__text=\ \"\${CD_CA_${cd_write_ca_certificates__index}}\"" - while [ "${cd_write_ca_certificates__text}" ] ; do + while [ -n "${cd_write_ca_certificates__text}" ] ; do cd_write_ca_certificates__path="\ ${CD_CA_ROOT}/${cd_write_ca_certificates__index}.crt" cd_split @@ -605,7 +605,7 @@ ${CD_PYTHON_PACKAGES}/${CD_GIT_CHILD}" cd_cat () { cd_cat__file="${1}" - if [ "${cd_cat__file}" ] ; then + if [ -n "${cd_cat__file}" ] ; then cd_open "${cd_cat__file}" cat "${cd_cat__file}" || exit cd_shut "${cd_cat__file}" @@ -613,7 +613,7 @@ cd_cat () { } cd_echo () { - if [ "${1}" ] ; then + if [ -n "${1}" ] ; then for cd_echo__name in "${@}" ; do eval "echo ${cd_echo__name} = \\\"\${${cd_echo__name}}\\\"" done @@ -634,7 +634,7 @@ cd_error_os () { cd_grep_os () { cd_grep_os__variable="${1}" - if [ "${cd_grep_os__variable}" ] ; then + if [ -n "${cd_grep_os__variable}" ] ; then grep "^${cd_grep_os__variable}=" "/etc/os-release" \ | sed "s|^${cd_grep_os__variable}=||" \ | sed "s|^\"\(.*\)\"$|\1|" @@ -643,14 +643,14 @@ cd_grep_os () { cd_install_package () { cd_install_package__name="${1}" - if [ "${cd_install_package__name}" ] ; then + if [ -n "${cd_install_package__name}" ] ; then ${CD_PM_INSTALL} "${cd_install_package__name}" || exit fi } cd_ln_python () { cd_ln_python__command="${1}" - if [ "${cd_ln_python__command}" ] ; then + if [ -n "${cd_ln_python__command}" ] ; then echo "→ ${CD_PYTHON_ALIAS} → ${cd_ln_python__command}" ln -f -s "${cd_ln_python__command}" "/usr/bin/${CD_PYTHON_ALIAS}" \ || exit @@ -659,7 +659,7 @@ cd_ln_python () { cd_ls () { cd_ls__path="${1}" - if [ "${cd_ls__path}" ] ; then + if [ -n "${cd_ls__path}" ] ; then cd_open "${cd_ls__path}" ls -a -l "${cd_ls__path}" || exit cd_shut "${cd_ls__path}" @@ -668,7 +668,7 @@ cd_ls () { cd_mkdir () { cd_mkdir__path="${1}" - if [ "${cd_mkdir__path}" ] ; then + if [ -n "${cd_mkdir__path}" ] ; then echo "→ ${cd_mkdir__path}" mkdir --parents "${cd_mkdir__path}" || exit fi @@ -728,7 +728,7 @@ ${CD___UP}" cd_write () { cd_write__file="${1}" cd_write__text="${2}" - if [ "${cd_write__file}" ] ; then + if [ -n "${cd_write__file}" ] ; then [ -f "${cd_write__file}" ] && cd_cat "${cd_write__file}" echo "→ ${cd_write__file}" printf "%s" "${cd_write__text}" > "${cd_write__file}" || exit From 640d651a78d1f8d781d0d37b58820408e507a0cd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 18:29:10 +0200 Subject: [PATCH 345/392] " --- cd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd.sh b/cd.sh index 9496890..7cd5837 100644 --- a/cd.sh +++ b/cd.sh @@ -622,14 +622,14 @@ cd_echo () { cd_error_ci () { echo "× CI: ${*}" - exit ${CD_ERROR_CI} + exit "${CD_ERROR_CI}" } cd_error_os () { cd_error_os__variable="${1}" printf "× OS: " cd_echo "${cd_error_os__variable}" - exit ${CD_ERROR_OS} + exit "${CD_ERROR_OS}" } cd_grep_os () { From a9c8aa6b541f91e99a59885becc0b04c436b3d75 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 19:15:47 +0200 Subject: [PATCH 346/392] cd_write_python_module --- cd.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cd.sh b/cd.sh index 7cd5837..850307c 100644 --- a/cd.sh +++ b/cd.sh @@ -581,13 +581,15 @@ ${CD_PYTHON_PACKAGES}" cd_write_python_module () { cd_step "Write Python module" - cd_write "${CD_PYTHON_PACKAGES}/env.py" "\ -$(cd_echo CD_OPEN CD_DOWN) -$(cd_echo CD_VERT CD_SPLT) -$(cd_echo CD___UP CD_SHUT) - -$(cd_echo CD_OS_ID CD_OS_VERSION) - + for cd_write_python_module__variable \ + in OPEN DOWN VERT SPLT __UP SHUT OS_ID OS_VERSION ; do + cd_write_python_module__value="\ +$(cd_echo "CD_${cd_write_python_module__variable}")" + cd_write_python_module__text="${cd_write_python_module__text}\ +${cd_write_python_module__value} +" + done + cd_write "${CD_PYTHON_PACKAGES}/env.py" "${cd_write_python_module__text}\ CD_STEP = $((CD_STEP+1)) " } From 9450e7cb8ab770260adbc38ac8a1a3b6c0a49c18 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 19:21:59 +0200 Subject: [PATCH 347/392] cd_list_working_directory --- cd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 850307c..30f7de0 100644 --- a/cd.sh +++ b/cd.sh @@ -444,7 +444,8 @@ cd_set_packages_configuration () { cd_list_working_directory () { cd_step "List working directory" - cd_ls "$(realpath .)" + cd_list_working_directory__path="$(realpath .)" + cd_ls "${cd_list_working_directory__path}" } cd_set_https_verification_off () { From e6f9e2d0dd61dee9d3fabec9cfbfa286723e6e66 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 19:33:46 +0200 Subject: [PATCH 348/392] *) --- cd.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cd.sh b/cd.sh index 30f7de0..2ca6f20 100644 --- a/cd.sh +++ b/cd.sh @@ -372,6 +372,7 @@ Acquire::https::Verify-Peer False; "${CD_PM_APK}"|"${CD_PM_APT}") CD_PKG_SSH="openssh-client" ;; "${CD_PM_DNF}") CD_PKG_SSH="openssh-clients" ;; "${CD_PM_PACMAN}") CD_PKG_SSH="openssh" ;; + *) esac } @@ -384,6 +385,7 @@ cd_set_packages_repositories () { cd_set_packages_repositories__file="/etc/yum.repos.d/almalinux.repo" ;; "9") \ cd_set_packages_repositories__file="/etc/yum.repos.d/almalinux-baseos.repo" ;; + *) esac cd_sed "${cd_set_packages_repositories__file}" \ "|^mirrorlist|# mirrorlist|" \ @@ -412,6 +414,7 @@ deb ${CD_URL_CHOSEN}-security ${CD_OS_VERSION}-security main cd_set_packages_repositories__file="/etc/yum.repos.d/Rocky-BaseOS.repo" ;; "9") \ cd_set_packages_repositories__file="/etc/yum.repos.d/rocky.repo" ;; + *) esac cd_sed "${cd_set_packages_repositories__file}" \ "|^mirrorlist|# mirrorlist|" \ @@ -427,6 +430,7 @@ deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-updates main deb ${CD_URL_CHOSEN} ${CD_OS_VERSION}-security main " ;; + *) esac } @@ -437,6 +441,7 @@ cd_set_packages_configuration () { "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") export DEBIAN_FRONTEND="noninteractive" ;; + *) esac } From 76070daa431e3cf2ac7c8a3b864db2bb0951b3df Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 19:44:32 +0200 Subject: [PATCH 349/392] *) --- cd.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cd.sh b/cd.sh index 2ca6f20..eddae10 100644 --- a/cd.sh +++ b/cd.sh @@ -68,6 +68,7 @@ cd_set_environment_variables () { "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_OS_VERSION="$(cd_grep_os VERSION_CODENAME)" ;; + *) esac # check operating system version case "${CD_OS_ID}" in @@ -107,6 +108,7 @@ cd_set_environment_variables () { *) cd_error_os "CD_OS_VERSION" ;; esac ;; + *) esac cd_split cd_echo "CD_OS_ID" "CD_OS_VERSION" @@ -137,6 +139,7 @@ cd_set_environment_variables () { CD_CA_ROOT="/usr/local/share/ca-certificates" CD_CMD_CA="update-ca-certificates" ;; + *) esac cd_split cd_echo "CD_CA_ROOT" "CD_CMD_CA" @@ -154,6 +157,7 @@ cd_set_environment_variables () { "${CD_OS_ARCH}") CD_PM="${CD_PM_PACMAN}" ;; + *) esac cd_split cd_echo "CD_PM" @@ -227,6 +231,7 @@ Dir::Etc::SourceParts \"\"; Acquire::https::Verify-Peer False; " ;; + *) esac cd_split cd_echo "CD_PM_CLEAN" \ @@ -256,6 +261,7 @@ Acquire::https::Verify-Peer False; "${CD_OS_UBUNTU}") CD_URL_DEFAULT="http://archive.ubuntu.com/ubuntu" ;; + *) esac CD_URL_CHOSEN="${CD_URL_DEFAULT}" case "${CD_OS_ID}" in @@ -284,6 +290,7 @@ Acquire::https::Verify-Peer False; [ -n "${CD_URL_UBUNTU}" ] && CD_URL_CHOSEN="${CD_URL_UBUNTU}" \ || CD_URL_CHOSEN="https://ubuntu.mirrors.ovh.net/ubuntu" ;; + *) esac cd_split cd_echo "CD_URL_DEFAULT" "CD_URL_CHOSEN" @@ -305,6 +312,7 @@ Acquire::https::Verify-Peer False; case "${CD_OS_VERSION}" in "bookworm") CD_PYTHON_COMMAND="python3.11" ;; "bullseye") CD_PYTHON_COMMAND="python3.9" ;; + *) esac CD_PYTHON_PACKAGE="python3" ;; @@ -316,9 +324,11 @@ Acquire::https::Verify-Peer False; case "${CD_OS_VERSION}" in "noble") CD_PYTHON_COMMAND="python3.12" ;; "jammy") CD_PYTHON_COMMAND="python3.10" ;; + *) esac CD_PYTHON_PACKAGE="python3" ;; + *) esac # set python packages case "${CD_OS_ID}" in @@ -331,6 +341,7 @@ Acquire::https::Verify-Peer False; "${CD_OS_DEBIAN}"|"${CD_OS_UBUNTU}") CD_PYTHON_PACKAGES="/usr/lib/${CD_PYTHON_ALIAS}/dist-packages" ;; + *) esac cd_split cd_echo "CD_PYTHON_COMMAND" "CD_PYTHON_PACKAGE" "CD_PYTHON_PACKAGES" From 8c016627f95f6e613d6fce3476a37ead619c6bd1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 23:14:27 +0200 Subject: [PATCH 350/392] ifs --- cd.sh | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/cd.sh b/cd.sh index eddae10..1884737 100644 --- a/cd.sh +++ b/cd.sh @@ -350,16 +350,40 @@ Acquire::https::Verify-Peer False; # continuous integration platform if [ -n "${GITHUB_ACTIONS}" ] ; then # github → gitea → forgejo - CD_SERVER_URL="${GITHUB_SERVER_URL}" - CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" - CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" - CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" + if [ -n "${GITHUB_SERVER_URL}" ] ; then + CD_SERVER_URL="${GITHUB_SERVER_URL}" + else + cd_error_ci "GITHUB_SERVER_URL" + fi + if [ -n "${GITHUB_REPOSITORY}" ] ; then + CD_PROJECTS_GROUP="$(dirname "${GITHUB_REPOSITORY}")" + CD_PROJECT_NAME="$(basename "${GITHUB_REPOSITORY}")" + else + cd_error_ci "GITHUB_REPOSITORY" + fi + if [ -n "${GITHUB_REF_NAME}" ] ; then + CD_PROJECT_BRANCH="${GITHUB_REF_NAME}" + else + cd_error_ci "GITHUB_REF_NAME" + fi elif [ -n "${GITLAB_CI}" ] ; then # gitlab - CD_SERVER_URL="${CI_SERVER_URL}" - CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" - CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" - CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" + if [ -n "${CI_SERVER_URL}" ] ; then + CD_SERVER_URL="${CI_SERVER_URL}" + else + cd_error_ci "CI_SERVER_URL" + fi + if [ -n "${CI_PROJECT_PATH}" ] ; then + CD_PROJECTS_GROUP="$(dirname "${CI_PROJECT_PATH}")" + CD_PROJECT_NAME="$(basename "${CI_PROJECT_PATH}")" + else + cd_error_ci "CI_PROJECT_PATH" + fi + if [ -n "${CI_COMMIT_BRANCH}" ] ; then + CD_PROJECT_BRANCH="${CI_COMMIT_BRANCH}" + else + cd_error_ci "CI_COMMIT_BRANCH" + fi else # unsupported cd_error_ci "ø" From c60897e876a3745cb6285064dd37b5fb09b4abc1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 23:51:37 +0200 Subject: [PATCH 351/392] set_ssh --- cd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index 4ea730e..863e56d 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -119,9 +119,9 @@ def set_ssh(*arguments): if ssh_hosts: fs.write(known, ssh_hosts) os.chmod(known, 0o400) - cat(known) # browse(ssh) + cat(known) def open(*arguments): From 617aa98ee11dc5261e716535946c6c05415f2da9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 23:56:21 +0200 Subject: [PATCH 352/392] " --- cd/__main__.py | 6 +++--- cd/project.py | 12 ++++++------ cd/projects.py | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cd/__main__.py b/cd/__main__.py index d67667f..23bd676 100755 --- a/cd/__main__.py +++ b/cd/__main__.py @@ -6,13 +6,13 @@ import sys import cd -if __name__ == '__main__': +if __name__ == "__main__": command, *arguments = sys.argv command = os.path.basename(command) - if command == '__main__.py': + if command == "__main__.py": cd.set_ssh(*arguments) cd.install_commands(__file__) else: - command = command.replace('-', '_') + command = command.replace("-", "_") function = getattr(cd, command) function(*arguments) diff --git a/cd/project.py b/cd/project.py index d5a96d7..3d2e813 100644 --- a/cd/project.py +++ b/cd/project.py @@ -1,16 +1,16 @@ from os import path BRANCH = [ - 'GITHUB_REF_NAME', - 'CI_COMMIT_BRANCH', + "GITHUB_REF_NAME", + "CI_COMMIT_BRANCH", ] NAME = [ - 'GITHUB_REPOSITORY', - 'CI_PROJECT_PATH', + "GITHUB_REPOSITORY", + "CI_PROJECT_PATH", ] ROOT = [ - 'GITHUB_WORKSPACE', - 'CI_PROJECT_DIR', + "GITHUB_WORKSPACE", + "CI_PROJECT_DIR", ] diff --git a/cd/projects.py b/cd/projects.py index 81fe3db..4144f6a 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -1,12 +1,12 @@ from os import path GROUP_AND_NAME = [ - 'GITHUB_REPOSITORY', - 'CI_PROJECT_PATH', + "GITHUB_REPOSITORY", + "CI_PROJECT_PATH", ] SERVER_URL = [ - 'GITHUB_SERVER_URL', - 'CI_SERVER_URL', + "GITHUB_SERVER_URL", + "CI_SERVER_URL", ] From c84367a486d57630e8d0a3a01caf6260454b2021 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jun 2024 23:59:45 +0200 Subject: [PATCH 353/392] __init__ -> None --- cd/project.py | 2 +- cd/projects.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cd/project.py b/cd/project.py index 3d2e813..3ff02cd 100644 --- a/cd/project.py +++ b/cd/project.py @@ -15,7 +15,7 @@ ROOT = [ class Project: - def __init__(self, projects): + def __init__(self, projects) -> None: self.projects = projects # branch for variable in BRANCH: diff --git a/cd/projects.py b/cd/projects.py index 4144f6a..6f7c96a 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -11,7 +11,7 @@ SERVER_URL = [ class Projects: - def __init__(self, environment): + def __init__(self, environment) -> None: self.environment = environment # group, name for variable in GROUP_AND_NAME: From ab2560ded20e8ff94b2757d6acb67c1dd7aa7834 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 00:01:38 +0200 Subject: [PATCH 354/392] imports --- cd/__init__.py | 6 +++--- cd/__main__.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 863e56d..a5d1bb8 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -1,10 +1,10 @@ import os +import env +from rwx import fs, ps + from cd.project import Project from cd.projects import Projects -import env -from rwx import fs -from rwx import ps COMMANDS_PREFIX = "cd-" diff --git a/cd/__main__.py b/cd/__main__.py index 23bd676..af676cd 100755 --- a/cd/__main__.py +++ b/cd/__main__.py @@ -5,7 +5,6 @@ import sys import cd - if __name__ == "__main__": command, *arguments = sys.argv command = os.path.basename(command) From 807049f27b65cf1e4b673b174dd6e43523889245 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 17:23:57 +0200 Subject: [PATCH 355/392] returns --- cd/__init__.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index a5d1bb8..da2943e 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -12,11 +12,11 @@ projects = Projects(os.environ) project = Project(projects) -def cd_browse_workspace(): +def cd_browse_workspace() -> None: browse(project.root) -def cd_build_project(): +def cd_build_project() -> None: for extension in ["py", "sh"]: path = os.path.join(project.root, f"build.{extension}") if os.path.exists(path): @@ -26,7 +26,7 @@ def cd_build_project(): pass -def cd_clone_branch(): +def cd_clone_branch() -> None: print(f"""\ {project.url} ↓ @@ -40,12 +40,12 @@ def cd_clone_branch(): ) -def cd_list_environment(): +def cd_list_environment() -> None: for variable, value in sorted(projects.environment.items()): print(variable, "=", value) -def cd_synchronize(): +def cd_synchronize() -> None: host = "rwx.work" source = "out" user = "cd" @@ -64,7 +64,7 @@ def cd_synchronize(): ) -def browse(root: str): +def browse(root: str) -> None: paths = [] for directory, _, files in os.walk(root): for file in files: @@ -77,13 +77,13 @@ def browse(root: str): shut(root) -def cat(file: str): +def cat(file: str) -> None: open(file) print(fs.read_file_text(file).rstrip()) shut(file) -def install_commands(path): +def install_commands(path) -> None: step("Install commands") user = "/usr/local/bin" for command in [ @@ -97,7 +97,7 @@ def install_commands(path): os.symlink(path, os.path.join(user, f"{COMMANDS_PREFIX}{command}")) -def set_ssh(*arguments): +def set_ssh(*arguments) -> None: step("Set SSH") # ssh_key, ssh_hosts = arguments @@ -124,21 +124,21 @@ def set_ssh(*arguments): cat(known) -def open(*arguments): +def open(*arguments) -> None: print(env.CD_OPEN, end="") print(*arguments, flush=True) -def shut(*arguments): +def shut(*arguments) -> None: print(env.CD_SHUT, end="") print(*arguments, flush=True) -def split(): +def split() -> None: print(env.CD_SPLT, flush=True) -def step(*arguments): +def step(*arguments) -> None: env.CD_STEP += 1 print(env.CD_DOWN) print(env.CD_VERT, env.CD_STEP, *arguments) From 660cdbde117572559f83112fae146858233e9f9e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 18:09:53 +0200 Subject: [PATCH 356/392] Path --- cd/__init__.py | 30 +++++++++++++++--------------- cd/__main__.py | 4 ++-- cd/project.py | 6 +++--- cd/projects.py | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index da2943e..4d15ce0 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -1,4 +1,5 @@ import os +from pathlib import Path import env from rwx import fs, ps @@ -18,8 +19,8 @@ def cd_browse_workspace() -> None: def cd_build_project() -> None: for extension in ["py", "sh"]: - path = os.path.join(project.root, f"build.{extension}") - if os.path.exists(path): + path = Path(project.root) / f"build.{extension}" + if path.exists(): ps.run(path) break else: @@ -50,8 +51,7 @@ def cd_synchronize() -> None: source = "out" user = "cd" # - root = os.sep.join(["", - user, project.branch, projects.group, project.name]) + root = Path(os.sep) / user / project.branch / projects.group / project.name # target = f"{user}@{host}:{root}" ps.run("rsync", @@ -68,7 +68,7 @@ def browse(root: str) -> None: paths = [] for directory, _, files in os.walk(root): for file in files: - absolute_path = os.path.join(directory, file) + absolute_path = Path(directory) / file relative_path = os.path.relpath(absolute_path, start=root) paths.append(relative_path) open(root) @@ -85,7 +85,7 @@ def cat(file: str) -> None: def install_commands(path) -> None: step("Install commands") - user = "/usr/local/bin" + user = Path("/usr/local/bin") for command in [ "browse-workspace", "build-project", @@ -94,7 +94,7 @@ def install_commands(path) -> None: "synchronize", ]: print(command) - os.symlink(path, os.path.join(user, f"{COMMANDS_PREFIX}{command}")) + os.symlink(path, user / f"{COMMANDS_PREFIX}{command}") def set_ssh(*arguments) -> None: @@ -104,21 +104,21 @@ def set_ssh(*arguments) -> None: # ssh_type = "ed25519" # - home = os.path.expanduser("~") + home = Path("~").expanduser() # - ssh = os.path.join(home, ".ssh") - os.makedirs(ssh, exist_ok=True) - os.chmod(ssh, 0o700) + ssh = home / ".ssh" + ssh.mkdir(parents=True) + ssh.chmod(0o700) # - key = os.path.join(ssh, f"id_{ssh_type}") + key = ssh / f"id_{ssh_type}" if ssh_key: fs.write(key, ssh_key) - os.chmod(key, 0o400) + key.chmod(0o400) # - known = os.path.join(ssh, "known_hosts") + known = ssh / "known_hosts" if ssh_hosts: fs.write(known, ssh_hosts) - os.chmod(known, 0o400) + known.chmod(0o400) # browse(ssh) cat(known) diff --git a/cd/__main__.py b/cd/__main__.py index af676cd..891e6aa 100755 --- a/cd/__main__.py +++ b/cd/__main__.py @@ -1,13 +1,13 @@ #! /usr/bin/env python3 -import os import sys +from pathlib import Path import cd if __name__ == "__main__": command, *arguments = sys.argv - command = os.path.basename(command) + command = Path(command).name if command == "__main__.py": cd.set_ssh(*arguments) cd.install_commands(__file__) diff --git a/cd/project.py b/cd/project.py index 3ff02cd..51971d1 100644 --- a/cd/project.py +++ b/cd/project.py @@ -1,4 +1,4 @@ -from os import path +from pathlib import Path BRANCH = [ "GITHUB_REF_NAME", @@ -24,10 +24,10 @@ class Project: # name for variable in NAME: if value := projects.environment.get(variable, None): - self.name = path.basename(value) + self.name = Path(value).name # root for variable in ROOT: if value := projects.environment.get(variable, None): self.root = value # url - self.url = path.join(projects.url, self.name) + self.url = Path(projects.url) / self.name diff --git a/cd/projects.py b/cd/projects.py index 6f7c96a..616ff2d 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -1,4 +1,4 @@ -from os import path +from pathlib import Path GROUP_AND_NAME = [ "GITHUB_REPOSITORY", @@ -20,4 +20,4 @@ class Projects: # url for variable in SERVER_URL: if value := self.environment.get(variable, None): - self.url = path.join(value, self.group) + self.url = Path(value) / self.group From 49c046cb3d7b33d5b655958547e39c6e0d8c4cc3 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 18:41:20 +0200 Subject: [PATCH 357/392] split --- cd/projects.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cd/projects.py b/cd/projects.py index 616ff2d..9094c20 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -16,7 +16,9 @@ class Projects: # group, name for variable in GROUP_AND_NAME: if value := self.environment.get(variable, None): - self.group, self.name = path.split(value) + path = Path(value) + self.group = path.parent + self.name = path.name # url for variable in SERVER_URL: if value := self.environment.get(variable, None): From 4ebb93149061320291f1617ec8cbe85808d23ae0 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 18:52:29 +0200 Subject: [PATCH 358/392] exist_ok --- cd/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/__init__.py b/cd/__init__.py index 4d15ce0..a23ea49 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -107,7 +107,7 @@ def set_ssh(*arguments) -> None: home = Path("~").expanduser() # ssh = home / ".ssh" - ssh.mkdir(parents=True) + ssh.mkdir(exist_ok=True, parents=True) ssh.chmod(0o700) # key = ssh / f"id_{ssh_type}" From 3b6639084028008e9a35b8dca4823804f3b47a8d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 20:04:29 +0200 Subject: [PATCH 359/392] linting --- cd/project.py | 8 +++++++- cd/projects.py | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cd/project.py b/cd/project.py index 51971d1..bdb2426 100644 --- a/cd/project.py +++ b/cd/project.py @@ -1,4 +1,10 @@ +from __future__ import annotations + from pathlib import Path +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from cd.projects import Projects BRANCH = [ "GITHUB_REF_NAME", @@ -15,7 +21,7 @@ ROOT = [ class Project: - def __init__(self, projects) -> None: + def __init__(self: Project, projects: Projects) -> None: self.projects = projects # branch for variable in BRANCH: diff --git a/cd/projects.py b/cd/projects.py index 9094c20..a1ca31f 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pathlib import Path GROUP_AND_NAME = [ @@ -11,7 +13,7 @@ SERVER_URL = [ class Projects: - def __init__(self, environment) -> None: + def __init__(self: Projects, environment) -> None: self.environment = environment # group, name for variable in GROUP_AND_NAME: From 371d66cb6196bbc32ffbe658e75d8cca54d1a9b9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 20:28:09 +0200 Subject: [PATCH 360/392] linting --- cd/__init__.py | 4 ++-- cd/__main__.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index a23ea49..e85220a 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -83,7 +83,7 @@ def cat(file: str) -> None: shut(file) -def install_commands(path) -> None: +def install_commands(path: str) -> None: step("Install commands") user = Path("/usr/local/bin") for command in [ @@ -94,7 +94,7 @@ def install_commands(path) -> None: "synchronize", ]: print(command) - os.symlink(path, user / f"{COMMANDS_PREFIX}{command}") + (user / f"{COMMANDS_PREFIX}{command}").symlink_to(path) def set_ssh(*arguments) -> None: diff --git a/cd/__main__.py b/cd/__main__.py index 891e6aa..774fbe5 100755 --- a/cd/__main__.py +++ b/cd/__main__.py @@ -6,12 +6,11 @@ from pathlib import Path import cd if __name__ == "__main__": - command, *arguments = sys.argv - command = Path(command).name - if command == "__main__.py": + path, *arguments = sys.argv + name = Path(path).name + if name == "__main__.py": cd.set_ssh(*arguments) cd.install_commands(__file__) else: - command = command.replace("-", "_") - function = getattr(cd, command) + function = getattr(cd, name.replace("-", "_")) function(*arguments) From 736e4fccb90c1cf9887eeaf78225fcc830292a1b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 20:55:32 +0200 Subject: [PATCH 361/392] strings --- cd/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index e85220a..f18b635 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -97,7 +97,7 @@ def install_commands(path: str) -> None: (user / f"{COMMANDS_PREFIX}{command}").symlink_to(path) -def set_ssh(*arguments) -> None: +def set_ssh(*arguments: str) -> None: step("Set SSH") # ssh_key, ssh_hosts = arguments @@ -124,12 +124,12 @@ def set_ssh(*arguments) -> None: cat(known) -def open(*arguments) -> None: +def open(*arguments: str) -> None: print(env.CD_OPEN, end="") print(*arguments, flush=True) -def shut(*arguments) -> None: +def shut(*arguments: str) -> None: print(env.CD_SHUT, end="") print(*arguments, flush=True) @@ -138,7 +138,7 @@ def split() -> None: print(env.CD_SPLT, flush=True) -def step(*arguments) -> None: +def step(*arguments: str) -> None: env.CD_STEP += 1 print(env.CD_DOWN) print(env.CD_VERT, env.CD_STEP, *arguments) From 71f2370dad4d664aca3eabe3f90fa08b7002424a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 21:00:01 +0200 Subject: [PATCH 362/392] frame --- cd/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index f18b635..9783dd9 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -71,14 +71,14 @@ def browse(root: str) -> None: absolute_path = Path(directory) / file relative_path = os.path.relpath(absolute_path, start=root) paths.append(relative_path) - open(root) + frame(root) for path in sorted(paths): print(path) shut(root) def cat(file: str) -> None: - open(file) + frame(file) print(fs.read_file_text(file).rstrip()) shut(file) @@ -124,7 +124,7 @@ def set_ssh(*arguments: str) -> None: cat(known) -def open(*arguments: str) -> None: +def frame(*arguments: str) -> None: print(env.CD_OPEN, end="") print(*arguments, flush=True) From 2d8c6320dc5c6e3ccb588d198dff887e34fbe3e6 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 9 Jun 2024 23:15:19 +0200 Subject: [PATCH 363/392] init,main --- cd/__init__.py | 2 ++ cd/__main__.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cd/__init__.py b/cd/__init__.py index 9783dd9..75b010d 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -1,3 +1,5 @@ +"""Continuous Deployment.""" + import os from pathlib import Path diff --git a/cd/__main__.py b/cd/__main__.py index 774fbe5..520006a 100755 --- a/cd/__main__.py +++ b/cd/__main__.py @@ -1,5 +1,7 @@ #! /usr/bin/env python3 +"""Entry point to either bootstrap or command.""" + import sys from pathlib import Path From 0eff166de69a2f5dbf20f21596afccd93f65f53d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 14:07:56 +0200 Subject: [PATCH 364/392] pyproject/ruff --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d7119c5 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.ruff] +select = ["ALL"] From 77bc6a0a445453c60bfb60130b1532f2fb4e31ca Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 14:12:02 +0200 Subject: [PATCH 365/392] docstrings --- cd/project.py | 1 + cd/projects.py | 1 + 2 files changed, 2 insertions(+) diff --git a/cd/project.py b/cd/project.py index bdb2426..c4e79d4 100644 --- a/cd/project.py +++ b/cd/project.py @@ -1,3 +1,4 @@ +"""CI project.""" from __future__ import annotations from pathlib import Path diff --git a/cd/projects.py b/cd/projects.py index a1ca31f..f536499 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -1,3 +1,4 @@ +"""CI projects.""" from __future__ import annotations from pathlib import Path From bdd58e90f20d3dbf8c1267432719890bbf11f0fd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 14:22:07 +0200 Subject: [PATCH 366/392] environ --- cd/__init__.py | 2 +- cd/projects.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 75b010d..fb08438 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -11,7 +11,7 @@ from cd.projects import Projects COMMANDS_PREFIX = "cd-" -projects = Projects(os.environ) +projects = Projects() project = Project(projects) diff --git a/cd/projects.py b/cd/projects.py index f536499..fa031f6 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -1,6 +1,7 @@ """CI projects.""" from __future__ import annotations +import os from pathlib import Path GROUP_AND_NAME = [ @@ -14,8 +15,8 @@ SERVER_URL = [ class Projects: - def __init__(self: Projects, environment) -> None: - self.environment = environment + def __init__(self: Projects) -> None: + self.environment = os.environ # group, name for variable in GROUP_AND_NAME: if value := self.environment.get(variable, None): From 2eb8792cb4d37104d1b5cc896cd63fd2a1ad066c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 18:16:19 +0200 Subject: [PATCH 367/392] fix projects url --- cd/projects.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cd/projects.py b/cd/projects.py index fa031f6..63c07f8 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -1,8 +1,10 @@ """CI projects.""" + from __future__ import annotations import os from pathlib import Path +from urllib.parse import urljoin GROUP_AND_NAME = [ "GITHUB_REPOSITORY", @@ -26,4 +28,4 @@ class Projects: # url for variable in SERVER_URL: if value := self.environment.get(variable, None): - self.url = Path(value) / self.group + self.url = urljoin(value, self.group) From a757855b3855632b89c6b3f3cdaddda5a50e0cf1 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 18:34:11 +0200 Subject: [PATCH 368/392] fix str --- cd/projects.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/projects.py b/cd/projects.py index 63c07f8..d2e0d5d 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -23,7 +23,7 @@ class Projects: for variable in GROUP_AND_NAME: if value := self.environment.get(variable, None): path = Path(value) - self.group = path.parent + self.group = str(path.parent) self.name = path.name # url for variable in SERVER_URL: From 3115d47d6deb411494d132a6f2f61144f5e92307 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 20:17:37 +0200 Subject: [PATCH 369/392] project/urljoin --- cd/project.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cd/project.py b/cd/project.py index c4e79d4..ad7aca1 100644 --- a/cd/project.py +++ b/cd/project.py @@ -1,8 +1,10 @@ """CI project.""" + from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING +from urllib import urljoin if TYPE_CHECKING: from cd.projects import Projects @@ -37,4 +39,4 @@ class Project: if value := projects.environment.get(variable, None): self.root = value # url - self.url = Path(projects.url) / self.name + self.url = urljoin(projects.url, self.name) From 0d4c6460e745c514ce223225c140c3092393b2cf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 20:47:35 +0200 Subject: [PATCH 370/392] urllib.parse --- cd/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd/project.py b/cd/project.py index ad7aca1..680b7d9 100644 --- a/cd/project.py +++ b/cd/project.py @@ -4,7 +4,7 @@ from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING -from urllib import urljoin +from urllib.parse import urljoin if TYPE_CHECKING: from cd.projects import Projects From 033898ccc095eeed2c453899f06a515e21be934a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 21:10:51 +0200 Subject: [PATCH 371/392] prj/str --- cd/__init__.py | 2 ++ cd/project.py | 8 ++++++++ cd/projects.py | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/cd/__init__.py b/cd/__init__.py index fb08438..cced3c9 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -12,7 +12,9 @@ from cd.projects import Projects COMMANDS_PREFIX = "cd-" projects = Projects() +print(projects) project = Project(projects) +print(project) def cd_browse_workspace() -> None: diff --git a/cd/project.py b/cd/project.py index 680b7d9..3981ee7 100644 --- a/cd/project.py +++ b/cd/project.py @@ -40,3 +40,11 @@ class Project: self.root = value # url self.url = urljoin(projects.url, self.name) + + def __str__(self: Project) -> str: + return """\ +branch = {self.branch} + name = {self.name} + root = {self.root} + url = {self.url} +""" diff --git a/cd/projects.py b/cd/projects.py index d2e0d5d..971f7a8 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -29,3 +29,10 @@ class Projects: for variable in SERVER_URL: if value := self.environment.get(variable, None): self.url = urljoin(value, self.group) + + def __str__(self: Projects) -> str: + return """\ +group = {self.group} + name = {self.name} + url = {self.url} +""" From b912997491f52f2ce3ab6cf322e754b3cc41cd83 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 10 Jun 2024 21:29:11 +0200 Subject: [PATCH 372/392] fixes --- cd/__init__.py | 6 ++++-- cd/project.py | 2 +- cd/projects.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index cced3c9..b1b377f 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -12,9 +12,7 @@ from cd.projects import Projects COMMANDS_PREFIX = "cd-" projects = Projects() -print(projects) project = Project(projects) -print(project) def cd_browse_workspace() -> None: @@ -32,6 +30,10 @@ def cd_build_project() -> None: def cd_clone_branch() -> None: + print(projects, end="") + split() + print(project, end="") + split() print(f"""\ {project.url} ↓ diff --git a/cd/project.py b/cd/project.py index 3981ee7..d1244d9 100644 --- a/cd/project.py +++ b/cd/project.py @@ -42,7 +42,7 @@ class Project: self.url = urljoin(projects.url, self.name) def __str__(self: Project) -> str: - return """\ + return f"""\ branch = {self.branch} name = {self.name} root = {self.root} diff --git a/cd/projects.py b/cd/projects.py index 971f7a8..e5dd41c 100644 --- a/cd/projects.py +++ b/cd/projects.py @@ -31,7 +31,7 @@ class Projects: self.url = urljoin(value, self.group) def __str__(self: Projects) -> str: - return """\ + return f"""\ group = {self.group} name = {self.name} url = {self.url} From 26013bf1a45150a0d35b662e881172431e327c5f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 12 Jun 2024 14:08:34 +0200 Subject: [PATCH 373/392] ignore .venv --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index bee8a64..9f7550b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ __pycache__ +.venv From ba771ea0fe1a4148ae2b94127243145195ce99bf Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 12 Jun 2024 14:09:25 +0200 Subject: [PATCH 374/392] ruff.lint --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d7119c5..d608a73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ -[tool.ruff] +[tool.ruff.lint] select = ["ALL"] From be045fb6ef3c592cab2af33f05d4bb68fc5bcd0d Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 12 Jun 2024 14:15:51 +0200 Subject: [PATCH 375/392] ignore formatter conflicting rules --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index d608a73..4075eff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,3 @@ [tool.ruff.lint] +ignore = ["COM812", "ISC001"] select = ["ALL"] From 2b78b45b1b33dace1096249ffb62e04975ba22b4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 12 Jun 2024 14:39:02 +0200 Subject: [PATCH 376/392] ignore linter conflicting rules --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4075eff..f543b45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [tool.ruff.lint] -ignore = ["COM812", "ISC001"] +ignore = ["COM812", "D203", "D213", "ISC001"] select = ["ALL"] From abd7afe65dca9e39d8c9100a6b4818a3a54934e9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 12 Jun 2024 14:40:39 +0200 Subject: [PATCH 377/392] format init --- cd/__init__.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index b1b377f..b310cfd 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -34,13 +34,19 @@ def cd_clone_branch() -> None: split() print(project, end="") split() - print(f"""\ + print( + f"""\ {project.url} ↓ -""", end="", flush=True) - ps.run("git", +""", + end="", + flush=True, + ) + ps.run( + "git", "clone", - "--branch", project.branch, + "--branch", + project.branch, "--", project.url, project.root, @@ -60,7 +66,8 @@ def cd_synchronize() -> None: root = Path(os.sep) / user / project.branch / projects.group / project.name # target = f"{user}@{host}:{root}" - ps.run("rsync", + ps.run( + "rsync", "--archive", "--delete-before", "--verbose", From 7d6700a04b89c952c0139573465c506e98780eca Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 12 Jun 2024 14:43:16 +0200 Subject: [PATCH 378/392] /.venv --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9f7550b..9195364 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ __pycache__ -.venv +/.venv From c5119b410727e0afc58c33c9d0314f009afaa09e Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 12 Jun 2024 14:56:12 +0200 Subject: [PATCH 379/392] ruff/line-length --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f543b45..8aa6871 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,6 @@ +[tool.ruff] +line-length = 80 + [tool.ruff.lint] ignore = ["COM812", "D203", "D213", "ISC001"] select = ["ALL"] From f776b8468d63b4078738fb488d3c375a55fd6421 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 13 Jun 2024 12:34:05 +0200 Subject: [PATCH 380/392] step/log --- cd/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index b310cfd..fa17729 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -5,6 +5,7 @@ from pathlib import Path import env from rwx import fs, ps +from rwx.log import stream as log from cd.project import Project from cd.projects import Projects @@ -153,6 +154,6 @@ def split() -> None: def step(*arguments: str) -> None: env.CD_STEP += 1 - print(env.CD_DOWN) + log.log(env.CD_DOWN) print(env.CD_VERT, env.CD_STEP, *arguments) - print(env.CD___UP, flush=True) + log.log(env.CD___UP) From 8185283391c802d784ad8eb994a2bec46bf905c2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 13 Jun 2024 13:25:17 +0200 Subject: [PATCH 381/392] log/info --- cd/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index fa17729..227e54d 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -154,6 +154,6 @@ def split() -> None: def step(*arguments: str) -> None: env.CD_STEP += 1 - log.log(env.CD_DOWN) + log.info(env.CD_DOWN) print(env.CD_VERT, env.CD_STEP, *arguments) - log.log(env.CD___UP) + log.info(env.CD___UP) From 936c15786532bd945914b724430cdd6cb3668e68 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 13 Jun 2024 13:44:59 +0200 Subject: [PATCH 382/392] log.info --- cd/__init__.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/cd/__init__.py b/cd/__init__.py index 227e54d..7c86330 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -31,11 +31,11 @@ def cd_build_project() -> None: def cd_clone_branch() -> None: - print(projects, end="") + log.info(projects) split() - print(project, end="") + log.info(project) split() - print( + log.info( f"""\ {project.url} ↓ @@ -56,7 +56,7 @@ def cd_clone_branch() -> None: def cd_list_environment() -> None: for variable, value in sorted(projects.environment.items()): - print(variable, "=", value) + log.info(f"{variable} = {value}") def cd_synchronize() -> None: @@ -87,13 +87,13 @@ def browse(root: str) -> None: paths.append(relative_path) frame(root) for path in sorted(paths): - print(path) + log.info(path) shut(root) def cat(file: str) -> None: frame(file) - print(fs.read_file_text(file).rstrip()) + log.info(fs.read_file_text(file).rstrip()) shut(file) @@ -107,7 +107,7 @@ def install_commands(path: str) -> None: "list-environment", "synchronize", ]: - print(command) + log.info(command) (user / f"{COMMANDS_PREFIX}{command}").symlink_to(path) @@ -138,22 +138,20 @@ def set_ssh(*arguments: str) -> None: cat(known) -def frame(*arguments: str) -> None: - print(env.CD_OPEN, end="") - print(*arguments, flush=True) +def frame(text: str) -> None: + log.info(f"{env.CD_OPEN}{text}") -def shut(*arguments: str) -> None: - print(env.CD_SHUT, end="") - print(*arguments, flush=True) +def shut(text: str) -> None: + log.info(f"{env.CD_SHUT}{text}") def split() -> None: - print(env.CD_SPLT, flush=True) + log.info(env.CD_SPLT) -def step(*arguments: str) -> None: +def step(text: str) -> None: env.CD_STEP += 1 log.info(env.CD_DOWN) - print(env.CD_VERT, env.CD_STEP, *arguments) + log.info(f"{env.CD_VERT} {env.CD_STEP} {text}") log.info(env.CD___UP) From 1a0f0936513fdab611b5f50e460173e9da76a240 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 09:16:28 +0200 Subject: [PATCH 383/392] readme/tasks --- readme.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/readme.md b/readme.md index 33bf913..79070d7 100644 --- a/readme.md +++ b/readme.md @@ -69,6 +69,9 @@ from various CA, CI, OCI / OS. ## Tasks +* opensuse +* ruff +* shellcheck * write bats * detect private key type @@ -81,3 +84,7 @@ from various CA, CI, OCI / OS. * override repository and framework locations * show previous states of directories & files * relay Python module name + +### .py + +### .sh From ffa161c7e012aa89c5c158ec70af70bd41428db8 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 09:55:16 +0200 Subject: [PATCH 384/392] readme/py,sh --- readme.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/readme.md b/readme.md index 79070d7..56e3d1e 100644 --- a/readme.md +++ b/readme.md @@ -69,22 +69,26 @@ from various CA, CI, OCI / OS. ## Tasks -* opensuse -* ruff -* shellcheck -* write bats - -* detect private key type -* handle git cloning credentials -* install rstnc and ssh from Python -* reduce single conditions with && -* write Python bootstrap process - -* integrate project repository cloning -* override repository and framework locations +* relay environment module name * show previous states of directories & files -* relay Python module name +* test with github +* test with gitea +* write tests ### .py +* detect ssh private key type +* implement project repository cloning +* install + * openssh + * rsync + * ruff + * shellcheck +* write bootstrap entry point + ### .sh + +* handle git cloning credentials +* override repository and framework locations +* reduce single conditions with && +* support opensuse From 0ac1a26ea2221517c3fbf7606cc1352cd063eedc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 10:02:31 +0200 Subject: [PATCH 385/392] readme/ci --- readme.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 56e3d1e..ef4b24f 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,7 @@ # Continuous Deployment -Get build-time Python commands \ -from various CA, CI, OCI / OS. +Get a common set of Python CI/CD commands \ +from various contexts of CA, CI and OCI / OS. ## Features @@ -9,7 +9,9 @@ from various CA, CI, OCI / OS. * [X] custom * [X] known * [ ] Continuous Integration platforms - * [X] GitHub → Gitea → ForgeJo + * [X] ForgeJo + * [ ] Gitea + * [ ] GitHub * [X] GitLab * [ ] SourceHut * [X] Operating Systems From 840b8a0d9f7697f7491e626eb1314fb01c16539f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 10:35:49 +0200 Subject: [PATCH 386/392] shellcheck/all --- .shellcheckrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..b1d708a --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +enable=all From d84b6f744bc76a52de9354794aff797217dccfb7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 11:59:10 +0200 Subject: [PATCH 387/392] readme/epel,pip --- readme.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index ef4b24f..5bcb7df 100644 --- a/readme.md +++ b/readme.md @@ -82,10 +82,15 @@ from various contexts of CA, CI and OCI / OS. * detect ssh private key type * implement project repository cloning * install + * epel + * shellcheck * openssh + * pip + * ruff * rsync - * ruff - * shellcheck +* lint + * .py + * .sh * write bootstrap entry point ### .sh From 70b6d9e0de1035c9dab2817d263c5b3c0ccfb1b7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 12:01:28 +0200 Subject: [PATCH 388/392] readme/bullseye --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 5bcb7df..b6a1738 100644 --- a/readme.md +++ b/readme.md @@ -25,7 +25,7 @@ from various contexts of CA, CI and OCI / OS. * [ ] 20231112 * [X] 20240101 * [X] Debian - * [X] Bullseye (11) → Python 3.9 + * [ ] Bullseye (11) → Python 3.9 * [X] Bookworm (12) → Python 3.11 * [X] Fedora → Python 3.12 * [X] 39 From 76232f808cbd25ee9f28a294f26e7248cb66a559 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 14:24:26 +0200 Subject: [PATCH 389/392] pyproject.toml --- pyproject.toml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8aa6871..6027135 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,36 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +authors = [ + { name = "Marc Beninca", email = "git@marc.beninca.link" }, +] +maintainers = [ + { name = "Marc Beninca", email = "git@marc.beninca.link" }, +] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Operating System :: OS Independent", +] +dependencies = ["rwx"] +description = "Continuous Deployment" +dynamic = ["version"] +keywords = [] +license-files = { paths = ["license.md"] } +name = "cd" +readme = "readme.md" +requires-python = ">= 3.10" + +[project.scripts] +# command = "package.module:function" + +[project.urls] + +[tool.hatch.version] +path = "cd/__init__.py" + [tool.ruff] line-length = 80 From 6ef22d519f1f82b23d17bcda7f80f813a25cb23f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 14:25:21 +0200 Subject: [PATCH 390/392] version --- cd/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cd/__init__.py b/cd/__init__.py index 7c86330..ca3b9c8 100644 --- a/cd/__init__.py +++ b/cd/__init__.py @@ -1,5 +1,7 @@ """Continuous Deployment.""" +__version__ = "0.0.1" + import os from pathlib import Path From 0777dfd2eb71ff97fe4d20a7acd33fe38c53e571 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 14 Jun 2024 14:26:12 +0200 Subject: [PATCH 391/392] ignore dist --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9195364..4a6a1c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__ +/dist /.venv From b9412e82aebd961e9295467e1756cc8cad41ab40 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 17 Jun 2024 18:56:31 +0200 Subject: [PATCH 392/392] cd_echo --- cd.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cd.sh b/cd.sh index 1884737..af48a0c 100644 --- a/cd.sh +++ b/cd.sh @@ -658,7 +658,8 @@ cd_cat () { cd_echo () { if [ -n "${1}" ] ; then for cd_echo__name in "${@}" ; do - eval "echo ${cd_echo__name} = \\\"\${${cd_echo__name}}\\\"" + eval "cd_echo__text=\"\${${cd_echo__name}}\"" + echo "${cd_echo__name} = \"${cd_echo__text}\"" done fi }