"pull" 参数在 drone 中有什么作用?

What does the "pull" parameter do in drone?

在使用 drone 的过程中,我见过几个在步骤中设置 pull: true 的情况。虽然不清楚是否需要这样做,因为有些步骤省略了它。

在无人机网站上使用in several examples但没有解释。

PS:我正在写这篇文章并回答我自己的问题,因为我找不到文档来解释这个问题,并且想让其他人更容易找到它。

你看到 pull: true 很多,因为无人机 0.X 默认是不升级图像。从drone 1.0开始默认是升级图片

无人机 1.0 docs 说:

If the image does not exist in the local cache, Drone instructs Docker to pull the image automatically. You will never need to manually pull images.

If the image is tagged with :latest either explicitly or implicitly, Drone attempts to pull the newest version of the image from the remote registry, even if the image exists in the local cache.

pull: if-not-exists # only pull the image if not found in the local cache
pull: always # always pull the newest version of the image
pull: never # never pull the image and always use the image in the local cache

无人机 0.8.0 docs 说:

Drone does not automatically upgrade docker images. Example configuration to always pull the latest image when updates are available:

pipeline:
  build:
    image: golang:latest
    pull: true

这是因为 CI 的可重复性是关键,进一步的更新可能会破坏您的构建。 source