mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
improve scripts
move logic to separated shell scripts and also create shell script for repository setup Also force create directory according to systemd recommendations
This commit is contained in:
21
.github/workflows/run-setup.yml
vendored
Normal file
21
.github/workflows/run-setup.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: setup
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
run-setup:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: setup the service in arch linux container
|
||||
run: |
|
||||
docker run \
|
||||
-v ${{ github.workspace }}:/build -w /build \
|
||||
archlinux:latest \
|
||||
.github/workflows/setup.sh
|
7
.github/workflows/run-tests.yml
vendored
7
.github/workflows/run-tests.yml
vendored
@ -18,9 +18,4 @@ jobs:
|
||||
docker run \
|
||||
-v ${{ github.workspace }}:/build -w /build \
|
||||
archlinux:latest \
|
||||
/bin/bash -c "pacman --noconfirm -Syu base-devel python-argparse-manpage python-pip && \
|
||||
pip install -e .[web] && \
|
||||
pip install -e .[check] && \
|
||||
pip install -e .[s3] && \
|
||||
pip install -e .[test] && \
|
||||
make check tests"
|
||||
.github/workflows/tests.sh
|
||||
|
47
.github/workflows/setup.sh
vendored
Executable file
47
.github/workflows/setup.sh
vendored
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# Install the package and run main install commands
|
||||
|
||||
set -ex
|
||||
|
||||
# install dependencies
|
||||
echo -e '[arcanisrepo]\nServer = http://repo.arcanis.me/$arch\nSigLevel = Never' | tee -a /etc/pacman.conf
|
||||
# main dependencies
|
||||
pacman --noconfirm -Sy base-devel devtools git pyalpm python-aur python-passlib python-srcinfo sudo
|
||||
# make dependencies
|
||||
pacman --noconfirm -Sy python-pip
|
||||
# optional dependencies
|
||||
# VCS support
|
||||
pacman --noconfirm -Sy breezy darcs mercurial subversion
|
||||
# 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
|
||||
# additional features
|
||||
pacman --noconfirm -Sy gnupg python-boto3 rsync
|
||||
|
||||
# create fresh tarball
|
||||
make VERSION=1.0.0 archlinux # well, it does not really matter which version we will put here
|
||||
# run makepkg
|
||||
mv ahriman-*-src.tar.xz package/archlinux
|
||||
chmod +777 package/archlinux # because fuck you that's why
|
||||
cd package/archlinux
|
||||
sudo -u nobody makepkg -cf --skipchecksums --noconfirm
|
||||
pacman --noconfirm -U ahriman-1.0.0-1-any.pkg.tar.zst
|
||||
|
||||
# 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
|
||||
# initial setup command as root
|
||||
sudo -u ahriman ahriman -a x86_64 init
|
||||
ahriman -a x86_64 repo-setup --packager "ahriman bot <ahriman@example.com>" --repository "github" --web-port 8080
|
||||
# enable services
|
||||
systemctl enable ahriman-web@x86_64
|
||||
systemctl enable ahriman@x86_64.timer
|
||||
# run web service (detached)
|
||||
sudo -u ahriman ahriman -a x86_64 web &
|
||||
WEBPID=$!
|
||||
sleep 15s # wait for the web service activation
|
||||
# add the first package
|
||||
# the build itself does not really work in the container because it requires procfs
|
||||
sudo -u ahriman ahriman package-add yay
|
||||
# run package check
|
||||
sudo -u ahriman ahriman repo-update
|
||||
# stop web service lol
|
||||
kill $WEBPID
|
16
.github/workflows/tests.sh
vendored
Executable file
16
.github/workflows/tests.sh
vendored
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# Install dependencies and run test in container
|
||||
|
||||
set -ex
|
||||
|
||||
# install dependencies
|
||||
pacman --noconfirm -Syu base-devel python-pip
|
||||
|
||||
# install python packages
|
||||
pip install -e .[web]
|
||||
pip install -e .[check]
|
||||
pip install -e .[s3]
|
||||
pip install -e .[test]
|
||||
|
||||
# run test and check targets
|
||||
make check tests
|
Reference in New Issue
Block a user