mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-11-16 05:23:41 +00:00
Compare commits
2 Commits
2.11.0
...
6fcb5449c3
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fcb5449c3 | |||
| 74209acc21 |
42
.github/workflows/docker-image.yml
vendored
42
.github/workflows/docker-image.yml
vendored
@ -1,42 +0,0 @@
|
|||||||
name: docker image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
- '!*rc*'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-image:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: extract docker metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v3
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
arcan1s/ahriman
|
|
||||||
tags: |
|
|
||||||
type=ref,event=tag
|
|
||||||
type=edge
|
|
||||||
|
|
||||||
- name: setup QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
|
|
||||||
- name: setup docker buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
|
|
||||||
- name: login to docker hub
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: build an image and push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
51
.github/workflows/docker.yml
vendored
Normal file
51
.github/workflows/docker.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
name: Docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
- '!*rc*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker-image:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to docker hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Login to github container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract docker metadata
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
arcan1s/ahriman
|
||||||
|
ghcr.io/arcan1s/ahriman
|
||||||
|
tags: |
|
||||||
|
type=semver,pattern={{raw}}
|
||||||
|
type=edge
|
||||||
|
|
||||||
|
- name: Build an image and push
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: release
|
name: Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -11,25 +11,25 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: extract version
|
- name: Extract version
|
||||||
id: version
|
id: version
|
||||||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
|
||||||
|
|
||||||
- name: create changelog
|
- name: Create changelog
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: jaywcjlove/changelog-generator@main
|
uses: jaywcjlove/changelog-generator@main
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
filter: 'Release \d+\.\d+\.\d+'
|
filter: 'Release \d+\.\d+\.\d+'
|
||||||
|
|
||||||
- name: create archive
|
- name: Create archive
|
||||||
run: make archive
|
run: make archive
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.version.outputs.VERSION }}
|
VERSION: ${{ steps.version.outputs.VERSION }}
|
||||||
|
|
||||||
- name: release
|
- name: Publish release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
body: |
|
body: |
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
name: setup
|
name: Setup
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -18,9 +18,9 @@ jobs:
|
|||||||
options: --privileged -w /build
|
options: --privileged -w /build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: setup the minimal service in arch linux container
|
- name: Setup the minimal service in arch linux container
|
||||||
run: .github/workflows/setup.sh minimal
|
run: .github/workflows/setup.sh minimal
|
||||||
|
|
||||||
run-setup:
|
run-setup:
|
||||||
@ -34,7 +34,7 @@ jobs:
|
|||||||
options: --privileged -w /build
|
options: --privileged -w /build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: setup the service in arch linux container
|
- name: Setup the service in arch linux container
|
||||||
run: .github/workflows/setup.sh
|
run: .github/workflows/setup.sh
|
||||||
@ -1,4 +1,4 @@
|
|||||||
name: tests
|
name: Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -18,7 +18,7 @@ jobs:
|
|||||||
options: -w /build
|
options: -w /build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: run check and tests in arch linux container
|
- name: Run check and tests in arch linux container
|
||||||
run: .github/workflows/tests.sh
|
run: .github/workflows/tests.sh
|
||||||
@ -1,8 +1,8 @@
|
|||||||
# ArcH linux ReposItory MANager
|
# ArcH linux ReposItory MANager
|
||||||
|
|
||||||
[](https://github.com/arcan1s/ahriman/actions/workflows/run-tests.yml)
|
[](https://github.com/arcan1s/ahriman/actions/workflows/run-tests.yml)
|
||||||
[](https://github.com/arcan1s/ahriman/actions/workflows/run-setup.yml)
|
[](https://github.com/arcan1s/ahriman/actions/workflows/run-setup.yml)
|
||||||
[](https://hub.docker.com/r/arcan1s/ahriman)
|
[](https://hub.docker.com/r/arcan1s/ahriman)
|
||||||
[](https://www.codefactor.io/repository/github/arcan1s/ahriman)
|
[](https://www.codefactor.io/repository/github/arcan1s/ahriman)
|
||||||
[](https://ahriman.readthedocs.io/?badge=latest)
|
[](https://ahriman.readthedocs.io/?badge=latest)
|
||||||
|
|
||||||
|
|||||||
@ -34,8 +34,9 @@ It will check current settings on common errors and compare configuration with k
|
|||||||
|
|
||||||
Base configuration settings.
|
Base configuration settings.
|
||||||
|
|
||||||
* ``include`` - path to directory with configuration files overrides, string, required.
|
* ``apply_migrations`` - perform migrations on application start, boolean, optional, default ``yes``. Useful if you are using git version. Note, however, that this option must be changed only if you know what to do and going to handle migrations automatically.
|
||||||
* ``database`` - path to SQLite database, string, required.
|
* ``database`` - path to SQLite database, string, required.
|
||||||
|
* ``include`` - path to directory with configuration files overrides, string, required.
|
||||||
* ``logging`` - path to logging configuration, string, required. Check ``logging.ini`` for reference.
|
* ``logging`` - path to logging configuration, string, required. Check ``logging.ini`` for reference.
|
||||||
* ``suppress_http_log_errors`` - suppress http log errors, boolean, optional, default ``no``. If set to ``yes``, any http log errors (e.g. if web server is not available, but http logging is enabled) will be suppressed.
|
* ``suppress_http_log_errors`` - suppress http log errors, boolean, optional, default ``no``. If set to ``yes``, any http log errors (e.g. if web server is not available, but http logging is enabled) will be suppressed.
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
[settings]
|
[settings]
|
||||||
include = ahriman.ini.d
|
include = ahriman.ini.d
|
||||||
logging = ahriman.ini.d/logging.ini
|
logging = ahriman.ini.d/logging.ini
|
||||||
|
apply_migrations = yes
|
||||||
database = /var/lib/ahriman/ahriman.db
|
database = /var/lib/ahriman/ahriman.db
|
||||||
suppress_http_log_errors = yes
|
suppress_http_log_errors = yes
|
||||||
|
|
||||||
|
|||||||
@ -30,17 +30,21 @@ CONFIGURATION_SCHEMA: ConfigurationSchema = {
|
|||||||
"settings": {
|
"settings": {
|
||||||
"type": "dict",
|
"type": "dict",
|
||||||
"schema": {
|
"schema": {
|
||||||
"include": {
|
"apply_migrations": {
|
||||||
"type": "path",
|
"type": "boolean",
|
||||||
"coerce": "absolute_path",
|
"coerce": "boolean",
|
||||||
"required": True,
|
|
||||||
"path_exists": True,
|
|
||||||
},
|
},
|
||||||
"database": {
|
"database": {
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"coerce": "absolute_path",
|
"coerce": "absolute_path",
|
||||||
"required": True,
|
"required": True,
|
||||||
},
|
},
|
||||||
|
"include": {
|
||||||
|
"type": "path",
|
||||||
|
"coerce": "absolute_path",
|
||||||
|
"required": True,
|
||||||
|
"path_exists": True,
|
||||||
|
},
|
||||||
"logging": {
|
"logging": {
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"coerce": "absolute_path",
|
"coerce": "absolute_path",
|
||||||
|
|||||||
@ -87,5 +87,6 @@ class SQLite(AuthOperations, BuildOperations, LogsOperations, PackageOperations,
|
|||||||
|
|
||||||
paths = configuration.repository_paths
|
paths = configuration.repository_paths
|
||||||
|
|
||||||
|
if configuration.getboolean("settings", "apply_migrations", fallback=True):
|
||||||
self.with_connection(lambda connection: Migrations.migrate(connection, configuration))
|
self.with_connection(lambda connection: Migrations.migrate(connection, configuration))
|
||||||
paths.chown(self.path)
|
paths.chown(self.path)
|
||||||
|
|||||||
@ -22,3 +22,14 @@ def test_init(database: SQLite, configuration: Configuration, mocker: MockerFixt
|
|||||||
migrate_schema_mock = mocker.patch("ahriman.core.database.migrations.Migrations.migrate")
|
migrate_schema_mock = mocker.patch("ahriman.core.database.migrations.Migrations.migrate")
|
||||||
database.init(configuration)
|
database.init(configuration)
|
||||||
migrate_schema_mock.assert_called_once_with(pytest.helpers.anyvar(int), configuration)
|
migrate_schema_mock.assert_called_once_with(pytest.helpers.anyvar(int), configuration)
|
||||||
|
|
||||||
|
|
||||||
|
def test_init_skip_migration(database: SQLite, configuration: Configuration, mocker: MockerFixture) -> None:
|
||||||
|
"""
|
||||||
|
must skip migrations if option is set
|
||||||
|
"""
|
||||||
|
configuration.set_option("settings", "apply_migrations", "no")
|
||||||
|
migrate_schema_mock = mocker.patch("ahriman.core.database.migrations.Migrations.migrate")
|
||||||
|
|
||||||
|
database.init(configuration)
|
||||||
|
migrate_schema_mock.assert_not_called()
|
||||||
|
|||||||
Reference in New Issue
Block a user