Commit 6ffa486b authored by Benjamin Tissoires's avatar Benjamin Tissoires
Browse files

also add the upstream repo as a container label



This will help the garbage collector to choose which images to keep.
The idea is that if we exclude the upstream images from the gc,
we will eventually end up in a state where we don't have to download
every now and then those upstream images, and only the forks images
would be deleted.

We can also use this as a way to clean up the registry itself:
if an image in a fork is not the upstream official one, we should
probably delete it instead of keeping millions of rebuilds. Which
means that next time the fork re-run the CI, it will use the
upstream image, which will likely already be on the runner.
Signed-off-by: Benjamin Tissoires's avatarBenjamin Tissoires <benjamin.tissoires@gmail.com>
parent 6898ece1
......@@ -230,6 +230,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
- export JOB_TAG="${DISTRO_TAG}-built-by-job-${CI_JOB_ID}"
......@@ -443,6 +448,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
......
......@@ -206,6 +206,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
- export JOB_TAG="${DISTRO_TAG}-built-by-job-${CI_JOB_ID}"
......
......@@ -206,6 +206,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
- export JOB_TAG="${DISTRO_TAG}-built-by-job-${CI_JOB_ID}"
......
......@@ -206,6 +206,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
- export JOB_TAG="${DISTRO_TAG}-built-by-job-${CI_JOB_ID}"
......
......@@ -216,6 +216,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
- export JOB_TAG="${DISTRO_TAG}-built-by-job-${CI_JOB_ID}"
......@@ -408,6 +413,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
......
......@@ -206,6 +206,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
- export JOB_TAG="${DISTRO_TAG}-built-by-job-${CI_JOB_ID}"
......@@ -399,6 +404,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
......
......@@ -215,6 +215,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
- export JOB_TAG="${DISTRO_TAG}-built-by-job-${CI_JOB_ID}"
......@@ -452,6 +457,11 @@
buildah config -l fdo.expires-after=$FDO_EXPIRES_AFTER $buildcntr;
fi
- if [[ x"$FDO_UPSTREAM_REPO" != x"" ]] ;
then
buildah config -l fdo.upstream-repo=$FDO_UPSTREAM_REPO $buildcntr;
fi
# tag the current container
- $BUILDAH_COMMIT $buildcntr $CI_REGISTRY_IMAGE/$FDO_REPO_SUFFIX:$DISTRO_TAG
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment