使用无人机对接插件来创建我的云映像,我想通过让无人机根据我正在使用的git分支名称自动标记我的图像来简化工作流程。
我看到了一个auto_tag,但不幸的是它总是将我的图片标记为“最新的”。
###
# Tag deployment
# Docker image
###
push-tag-news:
image: plugins/docker
registry: docker.domain.com:5000
secrets: [docker_username, docker_password]
repo: docker.domain.com:5000/devs/news
auto_tag: true # Or how to specify the current branch for the tags: option?
when:
exclude: [master, dev]有人试过做类似的事吗?
我用的是无人机0.8
发布于 2018-02-13 07:29:04
在我看来,auto_tag使用的是存储库/git标记,您希望设置自定义的停靠者图像标记。
您可以使用这些变量中的任何一个http://docs.drone.io/environment-reference/。
尝试使用DRONE_COMMIT_BRANCH
build-docker-image:
image: plugins/docker
repo: myname/myrepo
secrets: [ docker_username, docker_password ]
tags:
- ${DRONE_COMMIT_BRANCH}
- latesthttps://stackoverflow.com/questions/48750144
复制相似问题