美文网首页
gitlab 动态子流水线+jsonnet

gitlab 动态子流水线+jsonnet

作者: wwq2020 | 来源:发表于2020-07-24 13:42 被阅读0次

创建.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")
}

相关文章

网友评论

      本文标题:gitlab 动态子流水线+jsonnet

      本文链接:https://www.haomeiwen.com/subject/zbyjlktx.html