Compare commits

...

5 commits

Author SHA1 Message Date
ee69c088c2
clone/gitlab
All checks were successful
/ job (push) Successful in 12m13s
2024-07-28 21:48:52 +02:00
e200ff583b
clone_project_branch 2024-07-28 20:54:20 +02:00
ff8a371253
clone-branch 2024-07-28 20:34:44 +02:00
5eae674f20
docker 2024-07-28 17:15:00 +02:00
c5ede4d6e9
readme/tasks 2024-07-28 17:10:54 +02:00
19 changed files with 45 additions and 57 deletions

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/almalinux:8
image: ${{vars.DOCKER}}almalinux:8
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/alpine:3.19
image: ${{vars.DOCKER}}alpine:3.19
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/archlinux:base-20231112.0.191179
image: ${{vars.DOCKER}}archlinux:base-20231112.0.191179
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/debian:bullseye
image: ${{vars.DOCKER}}debian:bullseye
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/fedora:39
image: ${{vars.DOCKER}}fedora:39
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/rockylinux:8
image: ${{vars.DOCKER}}rockylinux:8
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/ubuntu:jammy
image: ${{vars.DOCKER}}ubuntu:jammy
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/almalinux:9
image: ${{vars.DOCKER}}almalinux:9
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/alpine:3.20
image: ${{vars.DOCKER}}alpine:3.20
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/archlinux:base-20240101.0.204074
image: ${{vars.DOCKER}}archlinux:base-20240101.0.204074
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/debian:bookworm
image: ${{vars.DOCKER}}debian:bookworm
steps:
- name: spcd
run: >
@ -11,7 +11,6 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace
- run: spcd-synchronize

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/fedora:40
image: ${{vars.DOCKER}}fedora:40
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/rockylinux:9
image: ${{vars.DOCKER}}rockylinux:9
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -2,7 +2,7 @@ on: [push]
jobs:
job:
container:
image: ${{vars.DOCKER||'docker.io'}}/ubuntu:noble
image: ${{vars.DOCKER}}ubuntu:noble
steps:
- name: spcd
run: >
@ -11,6 +11,5 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace

View file

@ -3,7 +3,7 @@ jobs:
job:
runs-on: ubuntu-latest
container:
image: ${{vars.DOCKER||'docker.io'}}/debian:bookworm
image: ${{vars.DOCKER}}debian:bookworm
steps:
- name: spcd
run: >
@ -12,7 +12,6 @@ jobs:
"${{vars.SPCD_SSH_HOSTS}}"
- run: spcd-list-environment
- run: spcd-clone-branch
- run: spcd-build-project
- run: spcd-browse-workspace
- run: spcd-synchronize

View file

@ -1,4 +1,4 @@
image: ${DOCKER:-docker.io}/debian:bookworm
image: ${DOCKER}debian:bookworm
job:
script:
- >
@ -7,6 +7,5 @@ job:
${SPCD_SSH_HOSTS}
- spcd-list-environment
- spcd-clone-branch
- spcd-build-project
- spcd-browse-workspace

View file

@ -103,4 +103,5 @@ from various contexts of CA, CI and OCI / OS.
### .sh
* check if file & variable match
* support opensuse

View file

@ -9,13 +9,35 @@ from rwx import fs
from rwx.log import stream as log
from rwx.ps import run
import spcd
from spcd import cmd
from spcd.util import browse, cat, step
from spcd.ci import project, projects
from spcd.util import browse, cat, split, step
COMMANDS_PREFIX = "spcd-"
def clone_project_branch() -> None:
if not projects.environment.get("GITLAB_CI"):
step("Clone project branch")
log.info(projects)
split()
log.info(project)
split()
log.info(f"""\
{project.url}
""")
run(
"git",
"clone",
"--branch",
project.branch,
"--",
project.url,
project.root,
)
def install_commands(path: str) -> None:
step("Install commands")
user = Path("/usr/local/bin")
@ -34,8 +56,9 @@ def main(main: str) -> None:
path, *arguments = sys.argv
name = Path(path).name
if name == "__main__.py":
spcd.set_ssh(*arguments)
spcd.install_commands(main)
clone_project_branch()
set_ssh(*arguments)
install_commands(main)
else:
function = getattr(cmd, name.replace("-", "_"))
function(*arguments)

View file

@ -6,7 +6,7 @@ from rwx import ps
from rwx.log import stream as log
from spcd.ci import project, projects
from spcd.util import browse, split
from spcd.util import browse
def spcd_browse_workspace() -> None:
@ -23,26 +23,6 @@ def spcd_build_project() -> None:
pass
def spcd_clone_branch() -> None:
log.info(projects)
split()
log.info(project)
split()
log.info(f"""\
{project.url}
""")
ps.run(
"git",
"clone",
"--branch",
project.branch,
"--",
project.url,
project.root,
)
def spcd_list_environment() -> None:
for variable, value in sorted(projects.environment.items()):
log.info(f"{variable} = {value}")