Compare commits

...

3 commits

Author SHA1 Message Date
50b2b1403b
split
Some checks failed
/ job (push) Failing after 3m39s
2024-07-29 14:34:15 +02:00
5434be3157
ssh 2024-07-29 14:33:22 +02:00
2c5c28f364
list_environment_variables 2024-07-29 14:20:15 +02:00
19 changed files with 29 additions and 92 deletions

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}almalinux:8 image: ${{vars.DOCKER}}almalinux:8
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}alpine:3.19 image: ${{vars.DOCKER}}alpine:3.19
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}archlinux:base-20231112.0.191179 image: ${{vars.DOCKER}}archlinux:base-20231112.0.191179
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}debian:bullseye image: ${{vars.DOCKER}}debian:bullseye
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}fedora:39 image: ${{vars.DOCKER}}fedora:39
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}rockylinux:8 image: ${{vars.DOCKER}}rockylinux:8
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}ubuntu:jammy image: ${{vars.DOCKER}}ubuntu:jammy
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}almalinux:9 image: ${{vars.DOCKER}}almalinux:9
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}alpine:3.20 image: ${{vars.DOCKER}}alpine:3.20
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}archlinux:base-20240101.0.204074 image: ${{vars.DOCKER}}archlinux:base-20240101.0.204074
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,12 +5,11 @@ jobs:
image: ${{vars.DOCKER}}debian:bookworm image: ${{vars.DOCKER}}debian:bookworm
steps: steps:
- name: spcd - name: spcd
run: > env:
${{vars.SPCD}} SPCD_SSH_HOSTS: ${{vars.SPCD_SSH_HOSTS}}
"${{secrets.SPCD_SSH_KEY}}" SPCD_SSH_KEY: ${{secrets.SPCD_SSH_KEY}}
"${{vars.SPCD_SSH_HOSTS}}" run: ${{vars.SPCD}}
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace
- run: spcd-synchronize - run: spcd-synchronize

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}fedora:40 image: ${{vars.DOCKER}}fedora:40
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}rockylinux:9 image: ${{vars.DOCKER}}rockylinux:9
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -5,11 +5,7 @@ jobs:
image: ${{vars.DOCKER}}ubuntu:noble image: ${{vars.DOCKER}}ubuntu:noble
steps: steps:
- name: spcd - name: spcd
run: > run: ${{vars.SPCD}}
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace

View file

@ -6,12 +6,7 @@ jobs:
image: ${{vars.DOCKER}}debian:bookworm image: ${{vars.DOCKER}}debian:bookworm
steps: steps:
- name: spcd - name: spcd
run: > run: echo '${{vars.SPCD}}' | tr -d '\r' | sh -s
echo '${{vars.SPCD}}' | tr -d '\r' | sh -s
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-build-project - run: spcd-build-project
- run: spcd-browse-workspace - run: spcd-browse-workspace
- run: spcd-synchronize

View file

@ -1,11 +1,7 @@
image: ${DOCKER}debian:bookworm image: ${DOCKER}debian:bookworm
job: job:
script: script:
- > - sh ${SPCD}
sh ${SPCD}
${SPCD_SSH_KEY}
${SPCD_SSH_HOSTS}
- spcd-list-environment
- spcd-build-project - spcd-build-project
- spcd-browse-workspace - spcd-browse-workspace

View file

@ -127,7 +127,6 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")"
[ -n "${SPCD_PROJECT_PATH}" ] || spcd_error_ci "SPCD_PROJECT_PATH" [ -n "${SPCD_PROJECT_PATH}" ] || spcd_error_ci "SPCD_PROJECT_PATH"
[ -n "${SPCD_PROJECT_NAME}" ] || spcd_error_ci "SPCD_PROJECT_NAME" [ -n "${SPCD_PROJECT_NAME}" ] || spcd_error_ci "SPCD_PROJECT_NAME"
# #
spcd_split
spcd_echo "SPCD_PROJECT_BRANCH" \ spcd_echo "SPCD_PROJECT_BRANCH" \
"SPCD_PROJECT_ROOT" "SPCD_PROJECT_PATH" "SPCD_PROJECT_NAME" "SPCD_PROJECT_ROOT" "SPCD_PROJECT_PATH" "SPCD_PROJECT_NAME"
# set path # set path

View file

@ -44,17 +44,26 @@ def install_commands(path: str) -> None:
for command in [ for command in [
"browse-workspace", "browse-workspace",
"build-project", "build-project",
"list-environment",
"synchronize", "synchronize",
]: ]:
log.info(command) log.info(command)
(user / f"{COMMANDS_PREFIX}{command}").symlink_to(path) (user / f"{COMMANDS_PREFIX}{command}").symlink_to(path)
def list_environment_variables() -> None:
step("List environment variables")
for variable, value in sorted(projects.environment.items()):
if variable != "SPCD_SSH_KEY":
log.info(f"{variable} = {value}")
else:
log.info(f"{variable}")
def main(main: str) -> None: def main(main: str) -> None:
path, *arguments = sys.argv path, *arguments = sys.argv
name = Path(path).name name = Path(path).name
if name == "__main__.py": if name == "__main__.py":
list_environment_variables()
clone_project_branch() clone_project_branch()
set_ssh() set_ssh()
install_commands(main) install_commands(main)

View file

@ -3,7 +3,6 @@ from pathlib import Path
import env import env
from rwx import ps from rwx import ps
from rwx.log import stream as log
from spcd.ci import project, projects from spcd.ci import project, projects
from spcd.util import browse from spcd.util import browse
@ -23,14 +22,6 @@ def spcd_build_project() -> None:
pass pass
def spcd_list_environment() -> None:
for variable, value in sorted(projects.environment.items()):
if variable != "SPCD_SSH_KEY":
log.info(f"{variable} = {value}")
else:
log.info(f"{variable}")
def spcd_synchronize() -> None: def spcd_synchronize() -> None:
host = env.SPCD_PROJECT_PATH host = env.SPCD_PROJECT_PATH
source = "out" source = "out"