summaryrefslogtreecommitdiffstats
path: root/test/ostree.install
blob: dc8ada82d012f5f92abaf8c5f0ef49f19c4671c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
set -eu

# install/upgrade RPMs that apply to OSTree
# Note: cockpit-selinux would be desirable, but needs setroubleshoot-server which isn't installed
cd /var/tmp/

# rhel4edge includes cockpit packages in the image itself, fedora-coreos overlays them
. /usr/lib/os-release
if [ "${ID:-}" = "rhel" ]; then
    rpm-ostree override replace --cache-only cockpit-bridge-*.rpm \
        cockpit-system-*.rpm
    rpm-ostree install --cache-only cockpit-tests-*.rpm
else
    rpm-ostree install --cache-only cockpit-bridge-*.rpm \
        cockpit-networkmanager-*.rpm cockpit-system-*.rpm cockpit-tests-*.rpm
fi

# rhel4edge has passwordless sudo but a loads of tests don't expect that
if [ "${ID:-}" = "rhel" ]; then
    sed -i '$ d' /etc/sudoers
fi

# update cockpit-ws and install scripts in the container
for rpm in /var/tmp/cockpit-ws-*.rpm /var/tmp/cockpit-bridge-*.rpm; do
    rpm2cpio "$rpm" | cpio -i --make-directories --directory=/var/tmp/install
done
podman run --name build-cockpit -i \
    -v /var/tmp/:/run/build:Z \
    quay.io/cockpit/ws sh -exc '
cp -a /run/build/install/* /
cp /run/build/containers/ws/label-* /run/build/containers/ws/default-bastion.conf /run/build/containers/ws/cockpit-auth-ssh-key /container/
'
podman commit --change CMD=/container/label-run build-cockpit localhost/cockpit/ws
podman rm -f build-cockpit

# move original quay.io image away, to make sure that our tests use the updated one
podman tag quay.io/cockpit/ws:latest quay.io/cockpit/original-ws:released
podman rmi quay.io/cockpit/ws:latest

# run cockpit/ws once to generate certificate; avoids slow down on every start
podman container runlabel INSTALL cockpit/ws