-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
piuparts tests package installation, upgrade and removal. We don't care that much about the last one so it's just a warning for now. For each package, piuparts will install the package CI just built and ensure that goes smoothly, making sure all the dependencies are present and the postinst works. Issues that were found are being fixed in the next commit. At a later stage, once the released packages are passing piuparts too, we can have it automatically grab the latest package from apt.freedom.press, install that, and then test the upgrade path to the new CI-built packages. This CI setup relies on running docker-in-docker, which is hacky but seems to work. Unfortunately it doesn't work for the client (starts apparmor), workstation-config (starts systemd) and workstation-viewer (pulls in grsec kernel). In the future we can look at switching into a chrooted setup that might fix the last two. Getting this to work in GitHub Actions was inspired by <https://github.com/evgeni/action-piuparts/> but I didn't really copy any code. Refs #1785.
- Loading branch information
Showing
3 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ARG DISTRO=bullseye | ||
FROM debian:$DISTRO | ||
|
||
RUN apt-get update && apt-get upgrade --yes && apt-get install -y ca-certificates | ||
# FIXME: Do this to fool piuparts into thinking we didn't remove /opt during | ||
# the package purge. Why does purging our packages not work properly? | ||
RUN rm -rf /opt | ||
# CI manifest will copy keyring into the build directory | ||
COPY securedrop-keyring.gpg /usr/share/keyrings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
# Runs inside the container | ||
apt-get update && apt-get install --yes piuparts docker.io | ||
|
||
cd /piuparts | ||
|
||
cp /keyring/securedrop-keyring.gpg . | ||
docker build . --build-arg DISTRO=$DISTRO -t ourimage | ||
|
||
# TODO: Our currently released packages don't install with piuparts, so we pass | ||
# --no-upgrade-test to avoid installing them and testing the upgrade path. Once | ||
# they do we can remove that line. | ||
piuparts --docker-image ourimage \ | ||
--distribution $DISTRO \ | ||
--extra-repo 'deb [signed-by=/usr/share/keyrings/securedrop-keyring.gpg] https://apt.freedom.press bullseye main' \ | ||
--warn-on-leftovers-after-purge \ | ||
--no-upgrade-test \ | ||
/build/securedrop-${PACKAGE}*.deb |