mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-05 16:29:55 +00:00
Compare commits
4 Commits
2.2.1
...
e0b0c3caeb
Author | SHA1 | Date | |
---|---|---|---|
e0b0c3caeb | |||
61969dd682 | |||
e441d93a56 | |||
664b6369bb |
16
.github/workflows/run-setup.yml
vendored
16
.github/workflows/run-setup.yml
vendored
@ -7,6 +7,22 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
run-setup-minimal:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: archlinux:latest
|
||||||
|
volumes:
|
||||||
|
- ${{ github.workspace }}:/build
|
||||||
|
options: --privileged -w /build
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: setup the minimal service in arch linux container
|
||||||
|
run: .github/workflows/setup.sh minimal
|
||||||
|
|
||||||
run-setup:
|
run-setup:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
13
.github/workflows/setup.sh
vendored
13
.github/workflows/setup.sh
vendored
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
[[ $1 = "minimal" ]] && MINIMAL_INSTALL=1
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
echo -e '[arcanisrepo]\nServer = http://repo.arcanis.me/$arch\nSigLevel = Never' | tee -a /etc/pacman.conf
|
echo -e '[arcanisrepo]\nServer = http://repo.arcanis.me/$arch\nSigLevel = Never' | tee -a /etc/pacman.conf
|
||||||
# refresh the image
|
# refresh the image
|
||||||
@ -12,12 +14,14 @@ pacman --noconfirm -Sy base-devel devtools git pyalpm python-aur python-passlib
|
|||||||
# make dependencies
|
# make dependencies
|
||||||
pacman --noconfirm -Sy python-build python-installer python-wheel
|
pacman --noconfirm -Sy python-build python-installer python-wheel
|
||||||
# optional dependencies
|
# optional dependencies
|
||||||
|
if [[ -z $MINIMAL_INSTALL ]]; then
|
||||||
# VCS support
|
# VCS support
|
||||||
pacman --noconfirm -Sy breezy darcs mercurial subversion
|
pacman --noconfirm -Sy breezy darcs mercurial subversion
|
||||||
# web server
|
# web server
|
||||||
pacman --noconfirm -Sy python-aioauth-client python-aiohttp python-aiohttp-debugtoolbar python-aiohttp-jinja2 python-aiohttp-security python-aiohttp-session python-cryptography python-jinja
|
pacman --noconfirm -Sy python-aioauth-client python-aiohttp python-aiohttp-debugtoolbar python-aiohttp-jinja2 python-aiohttp-security python-aiohttp-session python-cryptography python-jinja
|
||||||
# additional features
|
# additional features
|
||||||
pacman --noconfirm -Sy gnupg python-boto3 rsync
|
pacman --noconfirm -Sy gnupg python-boto3 rsync
|
||||||
|
fi
|
||||||
|
|
||||||
# create fresh tarball
|
# create fresh tarball
|
||||||
make VERSION=1.0.0 archlinux # well, it does not really matter which version we will put here
|
make VERSION=1.0.0 archlinux # well, it does not really matter which version we will put here
|
||||||
@ -33,14 +37,17 @@ systemd-machine-id-setup
|
|||||||
# special thing for the container, because /dev/log interface is not available there
|
# special thing for the container, because /dev/log interface is not available there
|
||||||
sed -i "s/handlers = syslog_handler/handlers = console_handler/g" /etc/ahriman.ini.d/logging.ini
|
sed -i "s/handlers = syslog_handler/handlers = console_handler/g" /etc/ahriman.ini.d/logging.ini
|
||||||
# initial setup command as root
|
# initial setup command as root
|
||||||
ahriman -a x86_64 repo-setup --packager "ahriman bot <ahriman@example.com>" --repository "github" --web-port 8080
|
[[ -z $MINIMAL_INSTALL ]] && WEB_ARGS=("--web-port" "8080")
|
||||||
|
ahriman -a x86_64 repo-setup --packager "ahriman bot <ahriman@example.com>" --repository "github" "${WEB_ARGS[@]}"
|
||||||
# enable services
|
# enable services
|
||||||
systemctl enable ahriman-web@x86_64
|
systemctl enable ahriman-web@x86_64
|
||||||
systemctl enable ahriman@x86_64.timer
|
systemctl enable ahriman@x86_64.timer
|
||||||
|
if [[ -z $MINIMAL_INSTALL ]]; then
|
||||||
# run web service (detached)
|
# run web service (detached)
|
||||||
sudo -u ahriman -- ahriman -a x86_64 web &
|
sudo -u ahriman -- ahriman -a x86_64 web &
|
||||||
WEBPID=$!
|
WEB_PID=$!
|
||||||
sleep 15s # wait for the web service activation
|
sleep 15s # wait for the web service activation
|
||||||
|
fi
|
||||||
# add the first package
|
# add the first package
|
||||||
# the build itself does not really work in the container
|
# the build itself does not really work in the container
|
||||||
sudo -u ahriman -- ahriman package-add --now yay
|
sudo -u ahriman -- ahriman package-add --now yay
|
||||||
@ -49,4 +56,4 @@ sudo -u ahriman -- ahriman package-add --now yay
|
|||||||
# run package check
|
# run package check
|
||||||
sudo -u ahriman -- ahriman repo-update
|
sudo -u ahriman -- ahriman repo-update
|
||||||
# stop web service lol
|
# stop web service lol
|
||||||
kill $WEBPID
|
[[ -z $WEB_PID ]] || kill $WEB_PID
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
<!-- Generated by graphviz version 5.0.0 (0)
|
<!-- Generated by graphviz version 5.0.1 (0)
|
||||||
-->
|
-->
|
||||||
<!-- Title: G Pages: 1 -->
|
<!-- Title: G Pages: 1 -->
|
||||||
<svg width="13233pt" height="4186pt"
|
<svg width="13233pt" height="4186pt"
|
||||||
viewBox="0.00 0.00 13232.57 4185.79" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
viewBox="0.00 0.00 13232.57 4185.79" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 4181.79)">
|
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 4181.79)">
|
||||||
<title>G</title><style>.edge>path:hover{stroke-width:8}</style>
|
<title>G</title><style>.edge>path:hover{stroke-width:8}</style>
|
||||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-4181.79 13228.57,-4181.79 13228.57,4 -4,4"/>
|
<polygon fill="white" stroke="none" points="-4,4 -4,-4181.79 13228.57,-4181.79 13228.57,4 -4,4"/>
|
||||||
<!-- ahriman_application_ahriman -->
|
<!-- ahriman_application_ahriman -->
|
||||||
<g id="node1" class="node">
|
<g id="node1" class="node">
|
||||||
<title>ahriman_application_ahriman</title><style>.edge>path:hover{stroke-width:8}</style>
|
<title>ahriman_application_ahriman</title><style>.edge>path:hover{stroke-width:8}</style>
|
||||||
|
Before Width: | Height: | Size: 537 KiB After Width: | Height: | Size: 537 KiB |
@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Evgeniy Alekseev
|
# Maintainer: Evgeniy Alekseev
|
||||||
|
|
||||||
pkgname='ahriman'
|
pkgname='ahriman'
|
||||||
pkgver=2.2.1
|
pkgver=2.2.2
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="ArcH linux ReposItory MANager"
|
pkgdesc="ArcH linux ReposItory MANager"
|
||||||
arch=('any')
|
arch=('any')
|
||||||
|
@ -57,6 +57,8 @@ class Sources(LazyLogging):
|
|||||||
return
|
return
|
||||||
|
|
||||||
architectures = Package.supported_architectures(sources_dir)
|
architectures = Package.supported_architectures(sources_dir)
|
||||||
|
if "any" in architectures: # makepkg does not like when there is any other arch except for any
|
||||||
|
return
|
||||||
architectures.add(architecture)
|
architectures.add(architecture)
|
||||||
patch = PkgbuildPatch("arch", list(architectures))
|
patch = PkgbuildPatch("arch", list(architectures))
|
||||||
patch.write(pkgbuild_path)
|
patch.write(pkgbuild_path)
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from sqlite3 import Connection, Cursor
|
|
||||||
from typing import Any, Dict, Tuple, TypeVar, Callable
|
from typing import Any, Dict, Tuple, TypeVar, Callable
|
||||||
|
|
||||||
from ahriman.core.lazy_logging import LazyLogging
|
from ahriman.core.lazy_logging import LazyLogging
|
||||||
@ -46,7 +45,7 @@ class Operations(LazyLogging):
|
|||||||
self.path = path
|
self.path = path
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def factory(cursor: Cursor, row: Tuple[Any, ...]) -> Dict[str, Any]:
|
def factory(cursor: sqlite3.Cursor, row: Tuple[Any, ...]) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
dictionary factory based on official documentation
|
dictionary factory based on official documentation
|
||||||
|
|
||||||
@ -62,7 +61,7 @@ class Operations(LazyLogging):
|
|||||||
result[column[0]] = row[index]
|
result[column[0]] = row[index]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def with_connection(self, query: Callable[[Connection], T], commit: bool = False) -> T:
|
def with_connection(self, query: Callable[[sqlite3.Connection], T], commit: bool = False) -> T:
|
||||||
"""
|
"""
|
||||||
perform operation in connection
|
perform operation in connection
|
||||||
|
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
__version__ = "2.2.1"
|
__version__ = "2.2.2"
|
||||||
|
@ -23,6 +23,18 @@ def test_extend_architectures(mocker: MockerFixture) -> None:
|
|||||||
write_mock.assert_called_once_with(Path("local") / "PKGBUILD")
|
write_mock.assert_called_once_with(Path("local") / "PKGBUILD")
|
||||||
|
|
||||||
|
|
||||||
|
def test_extend_architectures_any(mocker: MockerFixture) -> None:
|
||||||
|
"""
|
||||||
|
must skip architecture patching in case if there is any architecture
|
||||||
|
"""
|
||||||
|
mocker.patch("pathlib.Path.is_file", return_value=True)
|
||||||
|
mocker.patch("ahriman.models.package.Package.supported_architectures", return_value={"any"})
|
||||||
|
write_mock = mocker.patch("ahriman.models.pkgbuild_patch.PkgbuildPatch.write")
|
||||||
|
|
||||||
|
Sources.extend_architectures(Path("local"), "i686")
|
||||||
|
write_mock.assert_not_called()
|
||||||
|
|
||||||
|
|
||||||
def test_extend_architectures_skip(mocker: MockerFixture) -> None:
|
def test_extend_architectures_skip(mocker: MockerFixture) -> None:
|
||||||
"""
|
"""
|
||||||
must skip extending list of the architectures in case if no PKGBUILD file found
|
must skip extending list of the architectures in case if no PKGBUILD file found
|
||||||
|
Reference in New Issue
Block a user