ci
Some checks failed
/ job (push) Failing after 7m49s

This commit is contained in:
Marc Beninca 2024-07-13 00:46:07 +02:00
parent 3891e7d58a
commit 96c3313ddf
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 14 additions and 15 deletions

View file

@ -12,14 +12,9 @@ from rwx.log import stream as log
import spcd
from spcd import cmd
from spcd.project import Project
from spcd.projects import Projects
COMMANDS_PREFIX = "spcd-"
projects = Projects()
project = Project(projects)
def browse(root: str) -> None:
paths = []
@ -67,27 +62,27 @@ def main(main: str) -> None:
def set_ssh(*arguments: list[str]) -> None:
step("Set SSH")
#
# get variables
ssh_key, ssh_hosts = arguments
#
# set key type
ssh_type = "ed25519"
#
# set home directory
home = Path("~").expanduser()
#
# make home directory
ssh = home / ".ssh"
ssh.mkdir(exist_ok=True, parents=True)
ssh.chmod(0o700)
#
# write private key
key = ssh / f"id_{ssh_type}"
if ssh_key:
fs.write(key, ssh_key)
key.chmod(0o400)
#
# write known hosts
known = ssh / "known_hosts"
if ssh_hosts:
fs.write(known, ssh_hosts)
known.chmod(0o400)
#
# display
browse(ssh)
cat(known)

5
spcd/ci.py Normal file
View file

@ -0,0 +1,5 @@
from spcd.project import Project
from spcd.projects import Projects
projects = Projects()
project = Project(projects)

View file

@ -1,10 +1,11 @@
import os
from pathlib import Path
from ci import project, projects
from rwx import ps
from rwx.log import stream as log
from spcd import browse, project, projects, split
from spcd import browse, split
def spcd_browse_workspace() -> None:
@ -50,9 +51,7 @@ def spcd_synchronize() -> None:
host = "rwx.work"
source = "out"
user = "cd"
#
root = Path(os.sep) / user / project.branch / projects.group / project.name
#
target = f"{user}@{host}:{root}"
ps.run(
"rsync",