From 4d0024dc48b6a6d6cec255652fcdd16323c472da Mon Sep 17 00:00:00 2001 From: dd84ai Date: Sun, 12 Jan 2025 16:28:21 +0100 Subject: [PATCH] ci: more kcl code reusage --- kcls/common.k | 10 ++-------- kcls/wf_pages_staging.k | 3 ++- kcls/wf_test_build.k | 4 +++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/kcls/common.k b/kcls/common.k index 021e043..39a4f31 100644 --- a/kcls/common.k +++ b/kcls/common.k @@ -3,22 +3,16 @@ import infra.kcls.actions.install_go as go import infra.kcls.actions.install_taskfile as tf import infra.kcls.actions.install_templ as templ import infra.kcls.actions.patch_disco as disco +import infra.kcls.actions.darkstat _freelancer_folder = r"${{ github.workspace }}/fl-data" -schema BuildArgs: - site_root: str - freelancer_folder: str - heading: str - relay_host: str = "" - is_detailed: bool = False - TaskfileBuildVersion = ga.Step { name = "add versions" run = "task build-version" } -DarkstatBuildAssetsSteps = lambda a: BuildArgs { +DarkstatBuildAssetsSteps = lambda a: darkstat.BuildArgs { # return [ ga.Step {run = "ls ./fl-data"} diff --git a/kcls/wf_pages_staging.k b/kcls/wf_pages_staging.k index b497ff6..61fee53 100644 --- a/kcls/wf_pages_staging.k +++ b/kcls/wf_pages_staging.k @@ -1,6 +1,7 @@ import infra.kcls.models.github_workflow as gw import infra.kcls.common.github as ghc import infra.kcls.actions.checkout_freelancer as cf +import infra.kcls.actions.darkstat import .common as c @@ -25,7 +26,7 @@ _pages_staging_job: gw.Job = { freelancer_mod = cf._mod_discovery freelancer_folder = c._freelancer_folder }) - ] + c.DarkstatBuildAssetsSteps(c.BuildArgs { + ] + c.DarkstatBuildAssetsSteps(darkstat.BuildArgs { site_root = "/fl-darkstat/" freelancer_folder = c._freelancer_folder heading = 'DEV ENV fl-darkstat for Freelancer Discovery' diff --git a/kcls/wf_test_build.k b/kcls/wf_test_build.k index c228c1d..bff0e81 100644 --- a/kcls/wf_test_build.k +++ b/kcls/wf_test_build.k @@ -1,6 +1,8 @@ import infra.kcls.models.github_workflow as gw import infra.kcls.common.github as ghc import infra.kcls.actions.checkout_freelancer as cf +import infra.kcls.actions.darkstat + import .common as c _workflow = gw.Workflow { @@ -22,7 +24,7 @@ _test_job: gw.Job = { freelancer_mod = cf._mod_discovery freelancer_folder = c._freelancer_folder }) - ] + c.DarkstatBuildAssetsSteps(c.BuildArgs { + ] + c.DarkstatBuildAssetsSteps(darkstat.BuildArgs { site_root = "/fl-darkstat/" freelancer_folder = c._freelancer_folder heading = 'DEV ENV fl-darkstat for Freelancer Discovery'