Skip to content

Commit 8245227

Browse files
authored
Merge pull request #579 from thaJeztah/verify_update_comments_and_strategy
[ce-nightly] verify: remove old hack, and update comments to describe the process
2 parents 97eb421 + fa57144 commit 8245227

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

verify

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ function verify() {
2626
}
2727

2828
function verify_deb() {
29+
# First install prerequisites for our script and dpkg and apt to run correctly.
30+
# This list SHOULD NOT include dependencies of docker itself, otherwise we would
31+
# not be able to verify that our packages specify all the required dependencies.
2932
apt-get update
3033
apt-get -y install --no-install-recommends \
3134
apt-transport-https \
@@ -44,16 +47,6 @@ function verify_deb() {
4447
# All local packages need to be prefixed with `./` or else apt-get doesn't understand where to pull from
4548
packages=$(echo "${packages}" | awk '$0="./"$0' | xargs)
4649

47-
# For apt-get install, we don't want to install docker-scan-plugin, as it would
48-
# downgrade the already installed local package with an older version from
49-
# download.docker.com.
50-
# We search for packages starting with "docker-ce", which excludes "docker-scan-plugin"
51-
# as it doesn't have the "docker-ce" prefix. We match on "docker-c" so that we also
52-
# match "docker-ce.deb"
53-
apt_packages=$(find "packaging/deb/debbuild/${DIST_ID}-${DIST_VERSION}/" -type f -name "docker-c*.deb")
54-
# All local packages need to be prefixed with `./` or else apt-get doesn't understand where to pull from
55-
apt_packages=$(echo "${apt_packages}" | awk '$0="./"$0' | xargs)
56-
5750
(
5851
set -x
5952
# Install the locally built packages using 'dpkg' because installing with
@@ -64,16 +57,27 @@ function verify_deb() {
6457
# packages we know to be missing at this stage, and '--force-depends' to
6558
# only warn about any other missing dependency.
6659
#
67-
# Afterwards, we run 'apt-get install' with the '--fix-broken' option to
68-
# trigger installation of the dependencies, which should succceed succesfully.
6960
# shellcheck disable=SC2086
7061
dpkg \
7162
--ignore-depends=containerd.io,iptables,libdevmapper,libdevmapper1.02.1 \
7263
--force-depends \
7364
-i ${packages}
7465

66+
# After installing the local packages, we run 'apt-get install' with the
67+
# '--fix-broken' option to trigger installation of the dependencies, which
68+
# should succeed successfully. This step is to verify that not only the
69+
# packages can be installed, but also that all dependencies (including
70+
# containerd.io) can be resolved correctly for the distro that we built for,
71+
# before going through the whole pipeline and publishing the packages.
72+
#
73+
# The '--no-upgrade' option is set to prevent apt from attempting to install
74+
# packages from download(-stage).docker.com that we already installed using
75+
# the local packages above. Without this, installing (e.g.) ./docker-ce-cli
76+
# would result in apt installing "docker-ce" from the package repository and
77+
# produce a "the following packages will be DOWNGRADED" error.
78+
#
7579
# shellcheck disable=SC2086
76-
apt-get -y install --no-install-recommends --no-upgrade --fix-broken ${apt_packages}
80+
apt-get -y install --no-install-recommends --no-upgrade --fix-broken ${packages}
7781
)
7882
docker --version
7983
# FIXME this tries to connect to the docker daemon, which isn't started

0 commit comments

Comments
 (0)