Hosting platform for the Arch User Repository (AUR), a collection of packaging scripts created by the Arch Linux community
Find a file
Kevin Morris 5bd46d18a3 Improve Docker ecosystem
Instead of using Dockerfile for everything, we've introduced
a docker-compose.yml file and kept the Dockerfile to producing
a pure base image for the services defined.

docker-compose services:

- `mariadb` - Setup mariadb
- `sharness` - Run sharness suites
- `pytest-mysql` - Run pytest suites with MariaDB
- `pytest-sqlite` - Run pytest suites with SQLite
- `test` - Run all tests and produce a collective coverage report
    - This target mounts a cache volume and copies any successful
      coverage report back to `./cache/.coverage`. Users can run
      `./util/fix-coverage ./cache/.coverage` to rewrite source
      code paths and move coverage into place to view reports
      on your local system.

== Get Started ==

Build `aurweb:latest`.

    $ docker build -t aurweb:latest .

Run all tests via `docker-compose`.

    $ docker-compose up test

You can also purely run `pytest` in SQLite or MariaDB modes.

    $ docker-compose up pytest-sqlite
    $ docker-compose up pytest-mysql

Or `sharness` alone, which only uses SQLite internally.

    $ docker-compose up sharness

After running tests, coverage reports are stored in `./cache/.coverage`.
This database was most likely created in a different path, and so it
needs to be sanitized with `./util/fix-coverage`.

    $ ./util/fix-coverage cache/.coverage
    Copied coverage db to /path/to/aurweb/.coverage.
    $ coverage report
    ...
    $ coverage html
    $ coverage xml
    ...

Defined components:

**Entrypoints**

- mariadb-entrypoint.sh - setup mariadb and run its daemon
- test-mysql-entrypoint.sh - setup mysql configurations
- test-sqlite-entrypoint.sh - setup sqlite configurations
- tests-entrypoint.sh - setup mysql and sqlite configurations

**Scripts**

- run-mariadb.sh - setup databases
- run-pytests.sh - run pytest suites
- run-sharness.sh - run sharness suites
- run-tests.sh - run both pytests and sharness

**Health**

- mariadb.sh - A healthcheck script for the mariadb service
- pytest.sh - A healthcheck script for the pytest-* services
- sharness.sh - A healthcheck script for the sharness service

This Docker configuration is setup for tests, but should be
extendable for web and git servers.

**Changes to Makefile**

- Remove `.coverage` in the `clean` target
- Add a `coverage` target which prints a report and outputs xml

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-24 19:02:35 -07:00
.tx Rename translation resources from aur to aurweb 2018-07-07 16:05:12 +02:00
aurweb add logging.config.fileConfig 2021-06-24 18:56:38 -07:00
cache Improve Docker ecosystem 2021-06-24 19:02:35 -07:00
conf use aurweb_test for default mysql dev database 2021-06-24 19:02:35 -07:00
doc Update wiki links to the new short URL 2021-05-09 18:06:32 -04:00
docker Improve Docker ecosystem 2021-06-24 19:02:35 -07:00
migrations Merge branch 'master' into pu 2021-06-06 17:21:57 -07:00
po Translation updates from Transifex 2020-03-27 08:31:46 -04:00
schema bugfix: gendummydata.py was producing invalid usernames 2021-06-06 21:46:16 -07:00
templates aurweb.asgi: add security headers middleware 2021-06-22 20:33:45 -07:00
test Improve Docker ecosystem 2021-06-24 19:02:35 -07:00
upgrading Add new upgrade instructions 2020-03-27 08:49:34 -04:00
util Improve Docker ecosystem 2021-06-24 19:02:35 -07:00
web Merge branch 'master' into pu 2021-06-22 19:39:31 -07:00
.coveragerc Support SQLAlchemy 1.4 URL.create recommendation 2021-06-05 19:52:56 -07:00
.editorconfig add https://EditorConfig.org setup to ensure consistent style 2021-04-28 18:06:06 -04:00
.gitignore Improve Docker ecosystem 2021-06-24 19:02:35 -07:00
.gitlab-ci.yml use aurweb_test for default mysql dev database 2021-06-24 19:02:35 -07:00
.mailmap Update maintainer email address 2015-04-11 12:48:15 +02:00
.pre-commit-config.yaml pre-commit: add initial config 2021-02-20 11:24:30 -05:00
alembic.ini Set up Alembic for database migrations 2020-02-27 16:44:36 +01:00
AUTHORS AUTHORS: Add date ranges to current maintainers 2015-09-29 20:51:03 +02:00
CONTRIBUTING.md update documentation for FastAPI tests and deps. 2021-06-05 19:49:19 -07:00
COPYING added GPL2 as our license 2007-09-09 01:31:34 +00:00
docker-compose.yml Improve Docker ecosystem 2021-06-24 19:02:35 -07:00
Dockerfile Improve Docker ecosystem 2021-06-24 19:02:35 -07:00
INSTALL add python-lxml to dependencies 2021-06-05 20:11:17 -07:00
logging.conf add logging.config.fileConfig 2021-06-24 18:56:38 -07:00
README.md update documentation for FastAPI tests and deps. 2021-06-05 19:49:19 -07:00
setup.cfg Sanitize and modernize pytests 2021-06-05 20:11:17 -07:00
setup.py Refactor code to comply with flake8 and isort 2021-02-20 11:24:30 -05:00
TESTING doc: simplify database setup instructions in TESTING 2021-02-20 11:25:21 -05:00

aurweb

aurweb is a hosting platform for the Arch User Repository (AUR), a collection of packaging scripts that are created and submitted by the Arch Linux community. The scripts contained in the repository can be built using makepkg and installed using the Arch Linux package manager pacman.

The aurweb project includes

  • A web interface to search for packaging scripts and display package details.
  • An SSH/Git interface to submit and update packages and package meta data.
  • Community features such as comments, votes, package flagging and requests.
  • Editing/deletion of packages and accounts by Trusted Users and Developers.
  • Area for Trusted Users to post AUR-related proposals and vote on them.

Directory Layout

  • aurweb: aurweb Python modules, Git interface and maintenance scripts
  • conf: configuration and configuration templates
  • static: static resource files
  • templates: jinja2 template collection
  • doc: project documentation
  • po: translation files for strings in the aurweb interface
  • schema: schema for the SQL database
  • test: test suite and test cases
  • upgrading: instructions for upgrading setups from one release to another
  • web: PHP-based web interface for the AUR

Translations

Translations are welcome via our Transifex project at https://www.transifex.com/lfleischer/aurweb; see doc/i18n.txt for details.

Transifex

Testing

See test/README.md for details on dependencies and testing.