Compare commits
No commits in common. "c7c0d7c7d7fc7abacc8d929d23ce6e743e664efa" and "c481b2168c726c40e707c2e8c0b91dfaec90b18d" have entirely different histories.
c7c0d7c7d7
...
c481b2168c
2 changed files with 13 additions and 32 deletions
|
@ -44,7 +44,7 @@ def clone_project_branch() -> None:
|
|||
)
|
||||
|
||||
|
||||
def install_actions() -> None:
|
||||
def install_actions(path: Path) -> None:
|
||||
"""Make actions usable in workflows.
|
||||
|
||||
:param path: entry point file
|
||||
|
@ -54,32 +54,20 @@ def install_actions() -> None:
|
|||
name = "action.yaml"
|
||||
root = project.root / "act"
|
||||
vpy = Path(env.SPCD_PYTHON_VENV_BINARIES) / "python"
|
||||
for action in ["action", "synchronize"]:
|
||||
action = "synchronize"
|
||||
log.info(action)
|
||||
directory = root / action
|
||||
fs.make_directory(directory)
|
||||
match action:
|
||||
case "action":
|
||||
inputs = """\
|
||||
arg-1:
|
||||
required: true
|
||||
arg_2:
|
||||
required: true
|
||||
"""
|
||||
case "synchronize":
|
||||
inputs = """\
|
||||
fs.write(directory / name, f"""\
|
||||
inputs:
|
||||
source:
|
||||
default: out
|
||||
required: false
|
||||
"""
|
||||
yaml = f"""\
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- run: {vpy} -m spcd {action}
|
||||
inputs:
|
||||
{inputs}"""
|
||||
fs.write(directory / name, yaml)
|
||||
- run: {vpy} -m spcd synchronize
|
||||
""")
|
||||
cat(directory / name)
|
||||
|
||||
|
||||
|
|
13
spcd/act.py
13
spcd/act.py
|
@ -4,21 +4,14 @@ import os
|
|||
from pathlib import Path
|
||||
|
||||
from rwx import ps
|
||||
from rwx.log import stream as log
|
||||
|
||||
from spcd.ci import project, projects
|
||||
from spcd.shell import env
|
||||
|
||||
|
||||
def action() -> None:
|
||||
"""Display action inputs."""
|
||||
prefix = ""
|
||||
for variable, value in sorted(projects.environment.items()):
|
||||
if variable.startswith(prefix):
|
||||
log.info("%s = %s", variable, value)
|
||||
|
||||
|
||||
def synchronize(source: str | None = None, target: str | None = None) -> None:
|
||||
def synchronize(
|
||||
source: str | None = None, target: str | None = None
|
||||
) -> None:
|
||||
"""Synchronize output towards a target.
|
||||
|
||||
:param source: where to deploy from
|
||||
|
|
Loading…
Reference in a new issue