Debian Codegraph @

test/ostree.install

raw
1 #!/bin/sh
2 # install/upgrade RPMs that apply to OSTree
3 set -eu
4
5 # keep in sync with containers/ws/install.sh
6 PACKAGES="
7 kdump
8 networkmanager
9 packagekit
10 selinux
11 sosreport
12 storaged
13 system
14 "
15
16 cd /var/tmp/
17
18 # install/upgrade RPMs that apply to OSTree
19 # Note: cockpit-selinux would be desirable, but needs setroubleshoot-server which isn't installed
20 rpm-ostree install --cache-only cockpit-bridge-*.rpm \
21 cockpit-networkmanager-*.rpm cockpit-system-*.rpm
22
23 # update cockpit packages and install scripts in the container
24 for rpm in ws bridge $PACKAGES; do
25 rpm2cpio /var/tmp/cockpit-$rpm-*.rpm | cpio -i --make-directories --directory=/var/tmp/install
26 done
27
28 # Sometimes the actual quay.io/cockpit/ws Fedora version lags behind containers/ws/Containerfile, i.e. in between
29 # moving the latter to a new Fedora version, and releasing Cockpit and landing it in Fedora. Then the Python version
30 # in the rpms does not match the actual Python version in the container. So remove any traces of the old Python
31 # deployment first, unpack the new rpms, and move our Python module into place.
32 ws_pyver=$(podman run --rm --entrypoint /usr/bin/python3 quay.io/cockpit/ws -c \
33 'import sys; print("%d.%d" % sys.version_info[:2])')
34 ws_sitelib="/var/tmp/install/usr/lib/python${ws_pyver}"
35 if ! [ -d "$ws_sitelib" ]; then
36 echo "Adjusting Python module location to $ws_sitelib" >&2
37 mv --verbose /var/tmp/install/usr/lib/python3.* "$ws_sitelib" >&2
38 fi
39
40 podman run --name build-cockpit -i \
41 -v /var/tmp/:/run/build:Z \
42 quay.io/cockpit/ws sh -exc '
43 cp -a /run/build/install/* /
44 cp /run/build/containers/ws/label-* /run/build/containers/ws/default-bastion.conf /run/build/containers/ws/cockpit-auth-ssh-key /container/
45 # done in containers/ws/install.sh; this can be removed once that change is in our VM images
46 rm -f /usr/libexec/cockpit-session
47 '
48 podman commit --change CMD=/container/label-run build-cockpit localhost/cockpit/ws
49 podman rm -f build-cockpit
50
51 # move original quay.io image away, to make sure that our tests use the updated one
52 podman tag quay.io/cockpit/ws:latest quay.io/cockpit/original-ws:released
53 podman rmi quay.io/cockpit/ws:latest
54
55 # run cockpit/ws once to generate certificate; avoids slow down on every start
56 podman container runlabel INSTALL cockpit/ws