Skip to content

Commit

Permalink
ci: more kcl code reusage
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Jan 12, 2025
1 parent b36b96c commit 4d0024d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 2 additions & 8 deletions kcls/common.k
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
3 changes: 2 additions & 1 deletion kcls/wf_pages_staging.k
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 = '<span style="font-weight:1000;">DEV ENV</span> <a href="https://github.com/darklab8/fl-darkstat">fl-darkstat</a> for <a href="https://github.com/darklab8/fl-data-discovery">Freelancer Discovery</a>'
Expand Down
4 changes: 3 additions & 1 deletion kcls/wf_test_build.k
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 = '<span style="font-weight:1000;">DEV ENV</span> <a href="https://github.com/darklab8/fl-darkstat">fl-darkstat</a> for <a href="https://github.com/darklab8/fl-data-discovery">Freelancer Discovery</a>'
Expand Down

0 comments on commit 4d0024d

Please sign in to comment.