CI: simplify the logic for rebuilding the containers
authorBenjamin Tissoires <benjamin.tissoires@gmail.com>
Thu, 21 Mar 2019 08:35:40 +0000 (09:35 +0100)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 1 Apr 2019 04:11:20 +0000 (04:11 +0000)
commit6d96d417a01f53a62675c6804316d5fa760ea0c1
treeeb982957b5dcfeaad2ca347b8f091bd659eb4a92
parent51e66ab945af400c05a7c50814917e84ddf71a42
CI: simplify the logic for rebuilding the containers

right now the check_if_older_than_a_week rule does (in pseudo-code):
- get timestamp of current image or 0
- get timestamp of upstream image or 0
- if upstream image is newer than current image
  copy upstream image into current
- if we are in a scheduled pipeline, or if there is no current image
  (timestamp of 0), rebuild the current image

The ci-templates if-not-exists rule does:
- if there is a current image, exit
- if there is an upstream image, copy it to current and exit
- rebuild

Having the following is equivalent to the current behaviour and
can be used instead of check_if_older_than_a_week:
- if there is an upstream image, copy it to current and exit
- if there is a current image, exit
- rebuild

Because what matters is:

forks should be running the upstream image if available
forks should be running the latest upstream image in the libinput case
forks should be able to rebuild the images if there is no upstream
(change of the image tag)

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
.gitlab-ci.yml