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
steps:
- name: spcd
run: >
${{vars.SPCD}}
"${{secrets.SPCD_SSH_KEY}}"
"${{vars.SPCD_SSH_HOSTS}}"
run: ${{vars.SPCD}}
- run: spcd-list-environment
- run: spcd-build-project
- run: spcd-browse-workspace

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,11 +1,7 @@
image: ${DOCKER}debian:bookworm
job:
script:
- >
sh ${SPCD}
${SPCD_SSH_KEY}
${SPCD_SSH_HOSTS}
- sh ${SPCD}
- spcd-list-environment
- spcd-build-project
- 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_NAME}" ] || spcd_error_ci "SPCD_PROJECT_NAME"
#
spcd_split
spcd_echo "SPCD_PROJECT_BRANCH" \
"SPCD_PROJECT_ROOT" "SPCD_PROJECT_PATH" "SPCD_PROJECT_NAME"
# set path

View file

@ -44,17 +44,26 @@ def install_commands(path: str) -> None:
for command in [
"browse-workspace",
"build-project",
"list-environment",
"synchronize",
]:
log.info(command)
(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:
path, *arguments = sys.argv
name = Path(path).name
if name == "__main__.py":
list_environment_variables()
clone_project_branch()
set_ssh()
install_commands(main)

View file

@ -3,7 +3,6 @@ from pathlib import Path
import env
from rwx import ps
from rwx.log import stream as log
from spcd.ci import project, projects
from spcd.util import browse
@ -23,14 +22,6 @@ def spcd_build_project() -> None:
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:
host = env.SPCD_PROJECT_PATH
source = "out"