Compare commits

..

No commits in common. "aa76ba565036170de8f8802a74eb09a81f3bebb9" and "6978ba4873defa9353b9786baa129a9ff6b4a910" have entirely different histories.

2 changed files with 10 additions and 43 deletions

View File

@ -16,14 +16,9 @@ build:docker:
- docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_BUILD_REF_NAME}:${CI_BUILD_REF} - docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}/${CI_BUILD_REF_NAME}:${CI_BUILD_REF}
build:apt: build:apt:
image: debian:bookworm-slim image: debian:bookworm-slim # just to get "python3-jose" working
interruptible: true
stage: build stage: build
rules:
- if: $CI_COMMIT_BRANCH
before_script: before_script:
- echo "COMMIT=${CI_COMMIT_SHA}" >> version.env
# install build dependencies
- apt-get update -qq && apt-get install -qq -y build-essential - apt-get update -qq && apt-get install -qq -y build-essential
# create build directory for .deb sources # create build directory for .deb sources
- mkdir build - mkdir build
@ -48,15 +43,10 @@ build:apt:
build:pacman: build:pacman:
image: archlinux:base-devel image: archlinux:base-devel
interruptible: true
stage: build stage: build
rules:
- if: $CI_COMMIT_BRANCH
before_script: before_script:
- echo "COMMIT=${CI_COMMIT_SHA}" >> version.env
# install build dependencies
- pacman -Syu --noconfirm git - pacman -Syu --noconfirm git
# create a build-user because "makepkg" don't like root user # "makepkg" don't likes root user
- useradd --no-create-home --shell=/bin/false build && usermod -L build - useradd --no-create-home --shell=/bin/false build && usermod -L build
- 'echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - 'echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'
- 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'
@ -77,9 +67,6 @@ build:pacman:
test: test:
image: python:3.10-slim-bullseye image: python:3.10-slim-bullseye
stage: test stage: test
rules:
- if: $CI_COMMIT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
variables: variables:
DATABASE: sqlite:///../app/db.sqlite DATABASE: sqlite:///../app/db.sqlite
before_script: before_script:
@ -100,14 +87,13 @@ test:
variables: variables:
DEBIAN_FRONTEND: noninteractive DEBIAN_FRONTEND: noninteractive
before_script: before_script:
- apt-get update -qq && apt-get install -qq -y jq curl - apt-get update -qq && apt-get install -qq -y jq
script: script:
# test installation # test installation
- apt-get install -q -y ./build/build.deb --fix-missing - apt-get install -q -y ./build/build.deb --fix-missing
# copy example config from GitLab-CI-Variables # copy example config from GitLab-CI-Variables
#- cat ${EXAMPLE_CONFIG} > /etc/fastapi-dls/env #- cat ${EXAMPLE_CONFIG} > /etc/fastapi-dls/env
# start service in background # start service in background
- cd /usr/share/fastapi-dls/app
- uvicorn --host 127.0.0.1 --port 443 - uvicorn --host 127.0.0.1 --port 443
--app-dir /usr/share/fastapi-dls/app --app-dir /usr/share/fastapi-dls/app
--ssl-keyfile /etc/fastapi-dls/webserver.key --ssl-keyfile /etc/fastapi-dls/webserver.key
@ -132,12 +118,8 @@ test:ubuntu:
test:archlinux: test:archlinux:
image: archlinux:base image: archlinux:base
needs:
- job: build:pacman
artifacts: true
script: script:
- pacman -Sy - echo "Todo"
- pacman -U --noconfirm fastapi-dls-*.pkg.tar.zs
deploy:docker: deploy:docker:
stage: deploy stage: deploy
@ -170,7 +152,7 @@ deploy:apt:
image: debian:bookworm-slim image: debian:bookworm-slim
stage: deploy stage: deploy
rules: rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH #- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- changes: - changes:
- .DEBIAN/**/* - .DEBIAN/**/*
- app/**/* - app/**/*
@ -212,11 +194,11 @@ deploy:apt:
deploy:pacman: deploy:pacman:
image: archlinux:base-devel image: archlinux:base-devel
stage: deploy stage: deploy
rules: # rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# - changes: # - changes:
# - .PKGBUILD/**/* # - .PKGBUILD/**/*
# - app/**/* # - app/**/*
needs: needs:
- job: build:pacman - job: build:pacman
artifacts: true artifacts: true

View File

@ -217,21 +217,6 @@ apt-get install -f --fix-missing
Start with `systemctl start fastapi-dls.service` and enable autostart with `systemctl enable fastapi-dls.service`. Start with `systemctl start fastapi-dls.service` and enable autostart with `systemctl enable fastapi-dls.service`.
## ArchLinux (using `pacman`)
Packages are available here:
- [GitLab-Registry](https://git.collinwebdesigns.de/oscar.krause/fastapi-dls/-/packages)
```shell
pacman -Sy
FILENAME=/opt/fastapi-dls.pkg.tar.zst
url -o $FILENAME <download-url>
pacman -U --noconfirm fastapi-dls.pkg.tar.zst
```
Start with `systemctl start fastapi-dls.service` and enable autostart with `systemctl enable fastapi-dls.service`.
## Let's Encrypt Certificate ## Let's Encrypt Certificate
If you're using installation via docker, you can use `traefik`. Please refer to their documentation. If you're using installation via docker, you can use `traefik`. Please refer to their documentation.