Skip to content
Snippets Groups Projects
Unverified Commit a2f75963 authored by Oliver Smith's avatar Oliver Smith
Browse files

CI: wiki: adjust for 'pmbootstrap ci' (MR 3608)

Add a wrapper .ci/wiki.sh, that pmbootstrap ci can run and use it in
gitlab-ci.yml. Add a .ci/lib/gitlab_prepare_ci.sh script that makes a
user available with sudo, as expected by the pmbootstrap ci compatible
scripts. Set up binfmt_misc too while at it, it will be needed for
running pmbootstrap.

The next patches will adjust the rest of the CI scripts and move the old
scripts in the .ci/lib dir, so only the scripts that should be called
directly are in the .ci dir.

Related: https://postmarketos.org/pmb-ci
parent 23790a35
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
# Copyright 2021 Oliver Smith
# Copyright 2022 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import argparse
......@@ -13,7 +13,7 @@ def get_devices():
""":returns: list of all devices"""
ret = []
pmaports = (os.path.realpath(os.path.join(os.path.dirname(__file__) +
"/..")))
"/../..")))
for path in glob.glob(pmaports + "/device/*/device-*/"):
device = os.path.dirname(path).split("device-", 1)[1]
......
#!/bin/sh -e
# Copyright 2022 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
if ! mount | grep -q /proc/sys/fs/binfmt_misc; then
echo "Mounting binfmt_misc"
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
fi
if id "build" > /dev/null 2>&1; then
echo "User 'build' exists already"
else
echo "Creating build user"
adduser -D build
chown -R build:build .
echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
fi
#!/bin/sh -e
# Description: verify devices are documented in the wiki
# Options: native
# Run natively so we don't need to set up a chroot, python3 is the only dep.
# https://postmarktos.org/pmb-ci
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add \
python3
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
set -x
.ci/lib/check_devices_in_wiki.py --booting
......@@ -20,7 +20,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
......
......@@ -31,10 +31,9 @@ wiki:
- merge_requests
changes:
- device/*/device-*/*
before_script:
- apk -q add python3
script:
- .ci/check_devices_in_wiki.py --booting
- .ci/lib/gitlab_prepare_ci.sh
- .ci/wiki.sh
# testcases linting
testcases-linting:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment