【发布时间】:2020-12-30 10:33:23
【问题描述】:
由于最近 ubuntu-latest image 的更改引入了有缺陷的 docker-compose 版本,我不得不在我的管道上锁定 docker-compose 的版本。
但是,我曾经有一个任务可以帮助清理我的部署脚本,即DockerCompose@0。我正在尝试实现的等价于
- task: DockerCompose@0
displayName: 'Remove build options'
inputs:
action: 'Combine configuration'
removeBuildOptions: true
所以基本上我在考虑使用yq,它将解析 YAML 文件并删除不适用于堆栈部署的构建选项。但是,我不确定该怎么做。因为我需要从可能包含它的每个服务中删除它。
所以给出以下输入
services:
def:
build: ./def
image: trajano/def
ghi:
image: trajano/ghi
version: '3.7'
我想得到
services:
def:
image: trajano/def
ghi:
image: trajano/ghi
version: '3.7'
【问题讨论】:
标签: docker-compose yaml azure-pipelines yq