From b9479b16517f11de37c09c2788418042c3f6bbd6 Mon Sep 17 00:00:00 2001 From: Sergey Petushkov Date: Fri, 5 Jul 2024 09:12:20 +0200 Subject: [PATCH] fix(ci): use rpm instead of zypper to install mongosh in suse docker images (#2056) --- scripts/docker/suse12-rpm.Dockerfile | 5 ++++- scripts/docker/suse15-rpm.Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/docker/suse12-rpm.Dockerfile b/scripts/docker/suse12-rpm.Dockerfile index facdc8a24..8b6c1f292 100644 --- a/scripts/docker/suse12-rpm.Dockerfile +++ b/scripts/docker/suse12-rpm.Dockerfile @@ -4,7 +4,10 @@ ARG artifact_url="" ADD ${artifact_url} /tmp ADD node_modules /usr/share/mongodb-crypt-library-version/node_modules RUN zypper --no-gpg-checks --non-interactive refresh -RUN zypper --no-gpg-checks --non-interactive install /tmp/*mongosh*.rpm +# For some reason zypper ignores half of the files listed for installation in +# the rpm package (in particular the man files are not copied over as expected), +# using rpm directly seems to fix the issue +RUN rpm -i /tmp/*mongosh*.rpm RUN /usr/bin/mongosh --build-info RUN env MONGOSH_RUN_NODE_SCRIPT=1 mongosh /usr/share/mongodb-crypt-library-version/node_modules/.bin/mongodb-crypt-library-version /usr/lib64/mongosh_crypt_v1.so | grep -Eq '^mongo_(crypt|csfle)_v1-' ENTRYPOINT [ "mongosh" ] diff --git a/scripts/docker/suse15-rpm.Dockerfile b/scripts/docker/suse15-rpm.Dockerfile index 20d905b32..8d7b4696f 100644 --- a/scripts/docker/suse15-rpm.Dockerfile +++ b/scripts/docker/suse15-rpm.Dockerfile @@ -6,7 +6,10 @@ ADD node_modules /usr/share/mongodb-crypt-library-version/node_modules RUN zypper --no-gpg-checks --non-interactive addrepo https://download.opensuse.org/repositories/openSUSE:Leap:15.1:Update/standard/openSUSE:Leap:15.1:Update.repo RUN zypper --no-gpg-checks --non-interactive refresh RUN zypper --no-gpg-checks --non-interactive install man -RUN zypper --no-gpg-checks --non-interactive install /tmp/*mongosh*.rpm +# For some reason zypper ignores half of the files listed for installation in +# the rpm package (in particular the man files are not copied over as expected), +# using rpm directly seems to fix the issue +RUN rpm -i /tmp/*mongosh*.rpm RUN /usr/bin/mongosh --build-info RUN env MONGOSH_RUN_NODE_SCRIPT=1 mongosh /usr/share/mongodb-crypt-library-version/node_modules/.bin/mongodb-crypt-library-version /usr/lib64/mongosh_crypt_v1.so | grep -Eq '^mongo_(crypt|csfle)_v1-' RUN man mongosh | grep -q tlsAllowInvalidCertificates