如何创build重复资源和工作的汇合循环?

现在我有一个中继pipe道脚本,可以从一个git仓库更新dockerhub图像。 我基于下面的教程创build了这个。 我在这个git repo中有几个docker容器,我希望能够遍历它们来为每个不同的容器重复docker-image资源和image-update作业,使我的脚本更清晰,更具可读性。 这是我目前的脚本:

 --- resources: - name: resource-docker type: git source: uri: https://github.com/$MYUSER/$MYREPO.git branch: master # docker-image resources - name: first-container type: docker-image source: repository: $MYUSER/first-container - name: second-container type: docker-image source: repository: $MYUSER/second-container jobs: # image-update jobs - name: first-container-image-update public: true serial: true plan: - get: resource-docker - put: first-container params: build: resource-docker/first-container - name: second-container-image-update public: true serial: true plan: - get: resource-docker - put: second-container params: build: resource-docker/second-container 

我怎样才能改变这个,所以我只需要创build一个docker-image资源和image-update工作?

你不能,因为这不是Concourse的工作原理。

广场完全是陈述性的,幂等性的,可重复的和可重复的。 所以configuration过程的想法并不是这个工具支持的。 configuration应该设置一次,存储在版本控制下,然后是不可变的。

您可以首先自动生成pipe道YAML文件,或者编写一个报告每个Docker映像的新资源作为新的“版本”以通过单个pipe道 – 这与GitHub合并请求资源作品。