I want to generate a docker manifest in my pipeline. As I am using auto-tagging with the platform-specific images, the manifest should generate those versions (e.g. 0.9.3
/ 0.9
) as well.
Since this is not properly documented with the manifest plugin, I’ve tried it this way:
steps:
- name: manifest
image: plugins/manifest
settings:
target: my/image:${DRONE_TAG}
template: my/image:${DRONE_TAG}-ARCH
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm
But it seems Drone won’t escape the variables inside the plugin settings.
My second approach was to use a manifest template with the spec
and auto_tag
options, so the config looks like this:
steps:
- name: manifest
image: plugins/manifest
settings:
spec: manifest.tmpl
auto_tag: true
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm
This is not properly documented as well, so I took the template I found in the plugin’s repository and adjusted it slightly for my image name. Using that, I get the following output in the manifest step:
2018/11/17 00:19:10 pushing by spec
time="2018-11-17T00:19:10Z" level=fatal msg="Can't unmarshal YAML file \"/drone/src/manifest-014888304\": yaml: mapping values are not allowed in this context"
2018/11/17 00:19:10 exit status 1
What is the right way to do this?