github.com/goreleaser/nfpm/v2@v2.44.0/testdata/acceptance/archlinux.dockerfile (about) 1 FROM archlinux AS test_base 2 ARG package 3 RUN echo "${package}" 4 COPY ${package} /tmp/foo.pkg.tar.zst 5 6 7 # ---- minimal test ---- 8 FROM test_base AS min 9 RUN pacman --noconfirm -U /tmp/foo.pkg.tar.zst 10 11 12 # ---- symlink test ---- 13 FROM min AS symlink 14 RUN ls -l /path/to/symlink | grep "/path/to/symlink -> /etc/foo/whatever.conf" 15 16 17 # ---- simple test ---- 18 FROM min AS simple 19 RUN test -e /usr/bin/fake 20 RUN test -f /etc/foo/whatever.conf 21 RUN echo wat >> /etc/foo/whatever.conf 22 RUN pacman --noconfirm -R foo 23 RUN test -f /etc/foo/whatever.conf.pacsave 24 RUN test ! -f /usr/bin/fake 25 26 27 # ---- no-glob test ---- 28 FROM min AS no-glob 29 RUN test -d /usr/share/whatever/ 30 RUN test -f /usr/share/whatever/file1 31 RUN test -f /usr/share/whatever/file2 32 RUN test -d /usr/share/whatever/folder2 33 RUN test -f /usr/share/whatever/folder2/file1 34 RUN test -f /usr/share/whatever/folder2/file2 35 36 37 # ---- complex test ---- 38 FROM min AS complex 39 RUN pacman -Qi foo | grep "Depends On\\s*: bash" 40 RUN pacman -Qi foo | grep "Replaces\\s*: foo" 41 RUN pacman -Qi foo | grep "Provides\\s*: fake" 42 RUN test -e /usr/bin/fake 43 RUN test -f /etc/foo/whatever.conf 44 RUN test -d /usr/share/whatever/ 45 RUN test -d /usr/share/whatever/folder 46 RUN test -f /usr/share/whatever/folder/file1 47 RUN test -f /usr/share/whatever/folder/file2 48 RUN test -d /usr/share/whatever/folder/folder2 49 RUN test -f /usr/share/whatever/folder/folder2/file1 50 RUN test -f /usr/share/whatever/folder/folder2/file2 51 RUN test -d /var/log/whatever 52 RUN test -d /usr/share/foo 53 RUN test -d /usr/foo/bar/something 54 RUN test -d /etc/something 55 RUN test -f /etc/something/a 56 RUN test -f /etc/something/b 57 RUN test -d /etc/something/c 58 RUN test -f /etc/something/c/d 59 RUN test $(stat -c %a /usr/bin/fake2) -eq 4755 60 RUN test -f /tmp/preinstall-proof 61 RUN test -f /tmp/postinstall-proof 62 RUN test ! -f /tmp/preremove-proof 63 RUN test ! -f /tmp/postremove-proof 64 RUN echo wat >> /etc/foo/whatever.conf 65 RUN pacman --noconfirm -R foo 66 RUN test -f /etc/foo/whatever.conf.pacsave 67 RUN test ! -f /usr/bin/fake 68 RUN test ! -f /usr/bin/fake2 69 RUN test -f /tmp/preremove-proof 70 RUN test -f /tmp/postremove-proof 71 RUN test ! -d /var/log/whatever 72 RUN test ! -d /usr/share/foo 73 RUN test ! -d /usr/foo/bar/something 74 75 76 # ---- signed test ---- 77 FROM min AS signed 78 RUN echo "Arch Linux has no signature support" 79 80 81 # ---- overrides test ---- 82 FROM min AS overrides 83 RUN test -e /usr/bin/fake 84 RUN test -f /etc/foo/whatever.conf 85 RUN test ! -f /tmp/preinstall-proof 86 RUN test -f /tmp/postinstall-proof 87 RUN test ! -f /tmp/preremove-proof 88 RUN test ! -f /tmp/postremove-proof 89 RUN echo wat >> /etc/foo/whatever.conf 90 RUN pacman --noconfirm -R foo 91 RUN test -f /etc/foo/whatever.conf.pacsave 92 RUN test ! -f /usr/bin/fake 93 RUN test -f /tmp/preremove-proof 94 RUN test ! -f /tmp/postremove-proof 95 96 97 # ---- meta test ---- 98 FROM test_base AS meta 99 RUN pacman -Sy && pacman --noconfirm -U /tmp/foo.pkg.tar.zst 100 RUN command -v zsh 101 102 103 # ---- env-var-version test ---- 104 FROM min AS env-var-version 105 ENV EXPECTVER="foo 1.0.0-1" 106 RUN export FOUND_VER="$(pacman -Q foo)" && \ 107 echo "Expected: '${EXPECTVER}' :: Found: '${FOUND_VER}'" && \ 108 test "${FOUND_VER}" = "${EXPECTVER}" 109 110 111 # ---- changelog test ---- 112 FROM min AS withchangelog 113 RUN echo "Arch Linux has no changelog support" 114 115 116 # ---- upgrade test ---- 117 FROM test_base AS upgrade 118 ARG oldpackage 119 RUN echo "${oldpackage}" 120 COPY ${oldpackage} /tmp/old_foo.pkg.tar.zst 121 RUN pacman --noconfirm -U /tmp/old_foo.pkg.tar.zst 122 RUN test -f /tmp/preinstall-proof 123 RUN cat /tmp/preinstall-proof | grep "Install" 124 RUN test -f /tmp/postinstall-proof 125 RUN cat /tmp/postinstall-proof | grep "Install" 126 RUN test ! -f /tmp/preupgrade-proof 127 RUN test ! -f /tmp/postupgrade-proof 128 RUN echo modified > /etc/regular.conf 129 RUN echo modified > /etc/noreplace.conf 130 RUN pacman --noconfirm -U /tmp/foo.pkg.tar.zst 131 RUN test -f /tmp/preupgrade-proof 132 RUN test -f /tmp/postupgrade-proof 133 RUN test -f /etc/regular.conf 134 RUN test -f /etc/regular.conf.pacnew 135 RUN test -f /etc/noreplace.conf 136 RUN test -f /etc/noreplace.conf.pacnew