mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
start tinkering with starlark
This commit is contained in:
parent
067c257480
commit
bf11abf7ee
4 changed files with 57 additions and 0 deletions
25
.cirrus.star
Normal file
25
.cirrus.star
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
load("cirrus", environ="env")
|
||||||
|
load("github.com/cirrus-modules/helpers", "task", "container", "script")
|
||||||
|
|
||||||
|
task_list = {}
|
||||||
|
load("./ci/alpine/cirrus.star", "config")
|
||||||
|
task_list["alpine"] = config
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print("CIRRUS_PR", environ.get("CIRRUS_PR"))
|
||||||
|
print("CIRRUS_REPO_CLONE_TOKEN exists", "CIRRUS_REPO_CLONE_TOKEN" in environ)
|
||||||
|
print("CIRRUS_REPO_FULL_NAME", environ.get("CIRRUS_REPO_FULL_NAME"))
|
||||||
|
print("CIRRUS_CHANGE_IN_REPO", environ.get("CIRRUS_CHANGE_IN_REPO"))
|
||||||
|
print("CIRRUS_WORKING_DIR", environ.get("CIRRUS_WORKING_DIR"))
|
||||||
|
|
||||||
|
tasks = []
|
||||||
|
for t in task_list:
|
||||||
|
|
||||||
|
if environ.get("CIRRUS_REPO_FULL_NAME", "") == "zeek/zeek":
|
||||||
|
if t['zeek_task']:
|
||||||
|
tasks.append(t['zeek_task'])
|
||||||
|
elif environ.get("CIRRUS_REPO_FULL_NAME", "") == "zeek/broker":
|
||||||
|
if t['broker_task']:
|
||||||
|
tasks.append(t['broker_task'])
|
||||||
|
|
||||||
|
return tasks
|
16
ci/alpine/config.star
Normal file
16
ci/alpine/config.star
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
load("github.com/cirrus-modules/helpers", "task", "container", "script")
|
||||||
|
|
||||||
|
task_name = "alpine"
|
||||||
|
|
||||||
|
def zeek_task():
|
||||||
|
container_file = fs.read("Dockerfile")
|
||||||
|
return task(name=task_name,
|
||||||
|
instance=container(container_file),
|
||||||
|
instructions=[
|
||||||
|
script("Building alpine"),
|
||||||
|
])
|
||||||
|
|
||||||
|
def config():
|
||||||
|
return {"task_name": task_name,
|
||||||
|
"zeek_task": zeek_task,
|
||||||
|
"broker_task": None}
|
16
ci/centos-stream-10/config.star
Normal file
16
ci/centos-stream-10/config.star
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
load("github.com/cirrus-modules/helpers", "task", "container", "script")
|
||||||
|
|
||||||
|
task_name = "centos-stream-10"
|
||||||
|
|
||||||
|
def broker_task():
|
||||||
|
container_file = fs.read("Dockerfile")
|
||||||
|
return task(name=task_name,
|
||||||
|
instance=container(container_file),
|
||||||
|
instructions=[
|
||||||
|
script("Building alpine"),
|
||||||
|
])
|
||||||
|
|
||||||
|
def config():
|
||||||
|
return {"task_name": task_name,
|
||||||
|
"zeek_task": None,
|
||||||
|
"broker_task": broker_task}
|
Loading…
Add table
Add a link
Reference in a new issue