创建.gitlab-ci.ym,内容如下
jsonnet:
stage: build
image: alpine:latest
script:
- apk add -U jsonnet
- jsonnet demo.jsonnet > generated.yml
artifacts:
paths:
- generated.yml
jsonnet-test:
stage: test
needs:
- jsonnet
trigger:
include:
- artifact: generated.yml
job: jsonnet
strategy: depend
创建demo.jsonnet,内容如下
local job(script) =
{
image: "alpine:latest",
script: script
};
{
"job1": job("echo hello"),
"job2": job("echo world")
}
网友评论