forked from Mirror/pmbootstrap
CI started failing with: /builds/ollieparanoid/pmbootstrap/venv/bin/python3: No module named pytest I've briefly tried to fix this with the existing scripts. However, instead of investing more time into that, do the long overdue refactoring of the scripts that involve dropping the venv logic and support for a custon gitlab-ci-runner using some python docker image as base. This configuration hasn't been used for a long time and is probably broken anyway. Refactor the logic to skip the qemu test case in gitlab CI by using pytest markers. The new script is now similar to bpo's .ci/pytest.py.
36 lines
781 B
Bash
Executable file
36 lines
781 B
Bash
Executable file
#!/bin/sh -e
|
|
# Install pmbootstrap depends, set up pmos user with sudo
|
|
if [ "$(id -u)" != 0 ]; then
|
|
echo "ERROR: this script is meant to be executed in the gitlab-ci"
|
|
echo "environment only."
|
|
exit 1
|
|
fi
|
|
|
|
topdir="$(realpath "$(dirname "$0")/..")"
|
|
cd "$topdir"
|
|
|
|
ln -sf "$PWD"/pmbootstrap.py /usr/local/bin/pmbootstrap
|
|
|
|
apk add -q \
|
|
git \
|
|
openssl \
|
|
py3-pytest \
|
|
py3-pytest-cov \
|
|
sudo
|
|
|
|
adduser -D pmos
|
|
chown -R pmos:pmos .
|
|
echo 'pmos ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
|
|
|
su pmos -c "git config --global user.email postmarketos-ci@localhost"
|
|
su pmos -c "git config --global user.name postmarketOS_CI"
|
|
|
|
echo "Initializing pmbootstrap"
|
|
if ! su pmos -c "yes '' | pmbootstrap \
|
|
--details-to-stdout \
|
|
init \
|
|
>/tmp/pmb_init 2>&1"; then
|
|
cat /tmp/pmb_init
|
|
exit 1
|
|
fi
|
|
echo ""
|