Re: [igt-dev] [PATCH v3 5/6] gitlab-ci: rebuild images only on Dockerfile changes

Arkadiusz Hiler
2019-08-26T13:38:54Z

On Mon, Aug 26, 2019 at 04:12:47PM +0300, Oleg Vasilev wrote:
> Base images rarely change, there is not much sense in rebuilding it on
> every commit. GitLab already has mechanism for detecting such changes.
> However, it is only able to prevent rebuilding whenever there is no
> changes within the same ref. Since in our CI system, git tag is created
> on every series, the mechanism doesn't work.
>
> One possible way to workaround that is to compute a checksum of a
> Dockerfile, and rebuilding only if there was no image built with the
> same checksum.
>
> Signed-off-by: Oleg Vasilev <oleg.vasilev@intel.com>
> ---
> .gitlab-ci.yml | 39 +++++----------------------
> gitlab-ci/pull-or-rebuild.sh | 51 ++++++++++++++++++++++++++++++++++++

Please use `.gitlab-ci/` so it's consistent with .gitlab-ci.yml and what
others[0] are doing.

[0]: https://gitlab.freedesktop.org/mesa/mesa/tree/master/.gitlab-ci

--
Cheers,
Arek