From 12f661707fe25a2a4215d9b9a7c8a6560dfb0ccc Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 15:24:04 +0100 Subject: [PATCH 01/11] added PKGBUILD --- .gitlab-ci.yml | 17 +++++++++++++---- PKGBUILD | 23 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 PKGBUILD diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0176c7c..10ede8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,8 +15,7 @@ build:docker: - docker build . --tag ${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:package: - # debian:bullseye-slim +build:apt: image: debian:bookworm-slim # just to get "python3-jose" working stage: build before_script: @@ -42,6 +41,16 @@ build:package: paths: - build/build.deb +build:pamac: + image: archlinux:base-devel + stage: build + rules: + - if: $CI_COMMIT_BRANCH == "archlinux-makepkg" + script: + - ls -lah + - makepkg + - ls -lah + test: image: python:3.10-slim-bullseye stage: test @@ -60,7 +69,7 @@ test: .test:linux: stage: test needs: - - job: build:package + - job: build:apt artifacts: true variables: DEBIAN_FRONTEND: noninteractive @@ -130,7 +139,7 @@ deploy:debian: - DEBIAN/**/* - app/**/* needs: - - job: build:package + - job: build:apt artifacts: true before_script: - apt-get update -qq && apt-get install -qq -y curl lsb-release diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..d616130 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Oscar Krause +pkgname=fastapi-dls +pkgver=1.0.0 +pkgrel=3 +pkgdesc="Minimal Delegated License Service (DLS)." +arch=('any') +url="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls" +#license=('MIT') +depends=('python3' 'python-fastapi' 'uvicorn' 'python-dotenv' 'python-dateutil' 'python-jose' 'python-sqlalchemy' 'python-pycryptodome' 'python-markdown' 'openssl') +#source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz") +#sha256sums=('...') + +check() { + cd "$pkgname-$pkgver" + python3 "$pkgname.py" --version +} + +package() { + cd "$pkgname-$pkgver" + install -m 755 -TD "$pkgname.py" "$pkgdir/usr/bin/$pkgname" + install -m 644 -TD "README.md" "$pkgdir/usr/share/doc/$pkgname/README.md" + install -m 644 -TD "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} From bb43fc3f496aabdd506e174819248a86e93010c0 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 15:27:16 +0100 Subject: [PATCH 02/11] .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10ede8f..af11941 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,7 +48,8 @@ build:pamac: - if: $CI_COMMIT_BRANCH == "archlinux-makepkg" script: - ls -lah - - makepkg + - makepkg --help + - makepkg -si - ls -lah test: From 321cd17b0267338642def000ea9de128a8ddbdd3 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 15:57:55 +0100 Subject: [PATCH 03/11] updated PKGBUILD --- .gitlab-ci.yml | 9 +++++++-- PKGBUILD | 22 +++++++++------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af11941..72fad73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,11 +46,16 @@ build:pamac: stage: build rules: - if: $CI_COMMIT_BRANCH == "archlinux-makepkg" + before_script: + - useradd --no-create-home --shell=/bin/false build && usermod -L build + - 'echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' + - 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' + - chown -R build:build . script: - ls -lah - - makepkg --help - - makepkg -si + - source PKGBUILD && pacman -Syu --noconfirm --needed --asdeps "${makedepends[@]}" "${depends[@]}" - ls -lah + - sudo -u build makepkg --noextract #makepkg -si test: image: python:3.10-slim-bullseye diff --git a/PKGBUILD b/PKGBUILD index d616130..ff1757e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,23 +1,19 @@ # Maintainer: Oscar Krause pkgname=fastapi-dls pkgver=1.0.0 -pkgrel=3 +pkgrel=1 pkgdesc="Minimal Delegated License Service (DLS)." -arch=('any') +arch=('any') # x86_64? url="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls" #license=('MIT') depends=('python3' 'python-fastapi' 'uvicorn' 'python-dotenv' 'python-dateutil' 'python-jose' 'python-sqlalchemy' 'python-pycryptodome' 'python-markdown' 'openssl') -#source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz") -#sha256sums=('...') - -check() { - cd "$pkgname-$pkgver" - python3 "$pkgname.py" --version -} +source=('README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py') +sha512sums=("SKIP") package() { - cd "$pkgname-$pkgver" - install -m 755 -TD "$pkgname.py" "$pkgdir/usr/bin/$pkgname" - install -m 644 -TD "README.md" "$pkgdir/usr/share/doc/$pkgname/README.md" - install -m 644 -TD "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + mkdir -p "${pkgdir}/usr/share" + + cp "${srcdir}/README.md" "${pkgdir}/usr/share/README.md" + cp "${srcdir}/version.env" "${pkgdir}/usr/share/version.env" + cp -r "${srcdir}/app" "${pkgdir}/usr/share" } From 32a512b89bd69a10617d4f1754cd944dfedc19f9 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 15:59:38 +0100 Subject: [PATCH 04/11] fixes --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 72fad73..3f7cb42 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,10 +52,10 @@ build:pamac: - 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - chown -R build:build . script: - - ls -lah + - pwd - source PKGBUILD && pacman -Syu --noconfirm --needed --asdeps "${makedepends[@]}" "${depends[@]}" - ls -lah - - sudo -u build makepkg --noextract #makepkg -si + - sudo -u build makepkg -si test: image: python:3.10-slim-bullseye From 62af76b95abd5b058ce464e991e12243beb85b5d Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 17:00:35 +0100 Subject: [PATCH 05/11] added PKGBUILD --- PKGBUILD | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index ff1757e..adb3dce 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -7,13 +7,21 @@ arch=('any') # x86_64? url="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls" #license=('MIT') depends=('python3' 'python-fastapi' 'uvicorn' 'python-dotenv' 'python-dateutil' 'python-jose' 'python-sqlalchemy' 'python-pycryptodome' 'python-markdown' 'openssl') -source=('README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py') +source=() # 'README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py' sha512sums=("SKIP") package() { mkdir -p "${pkgdir}/usr/share" + echo "pkgdir: ${pkgdir}" + echo "srcdir: ${srcdir}" + echo "startDir: ${startDir}" + cp "${srcdir}/README.md" "${pkgdir}/usr/share/README.md" cp "${srcdir}/version.env" "${pkgdir}/usr/share/version.env" cp -r "${srcdir}/app" "${pkgdir}/usr/share" } + + +# https://bbs.archlinux.org/viewtopic.php?id=213287 +# https://itsfoss.com/create-pkgbuild/ From 15d52f7586523625b788fdb56a56ab0ead988177 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 17:01:57 +0100 Subject: [PATCH 06/11] added PKGBUILD --- PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKGBUILD b/PKGBUILD index adb3dce..07b34e9 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -7,7 +7,7 @@ arch=('any') # x86_64? url="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls" #license=('MIT') depends=('python3' 'python-fastapi' 'uvicorn' 'python-dotenv' 'python-dateutil' 'python-jose' 'python-sqlalchemy' 'python-pycryptodome' 'python-markdown' 'openssl') -source=() # 'README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py' +source=(".") # 'README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py' sha512sums=("SKIP") package() { From 7f99c260ce01ed17b528f7b946fc845f6531843e Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 17:05:59 +0100 Subject: [PATCH 07/11] added PKGBUILD --- .gitlab-ci.yml | 5 +++-- PKGBUILD | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f7cb42..d57937d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,8 +53,9 @@ build:pamac: - chown -R build:build . script: - pwd - - source PKGBUILD && pacman -Syu --noconfirm --needed --asdeps "${makedepends[@]}" "${depends[@]}" + #- source PKGBUILD && pacman -Syu --noconfirm --needed --asdeps "${makedepends[@]}" "${depends[@]}" - ls -lah + - ls -lah app/ - sudo -u build makepkg -si test: @@ -135,7 +136,7 @@ deploy:docker: - docker push $PUBLIC_REGISTRY_USER/${CI_PROJECT_NAME}:${VERSION} - docker push $PUBLIC_REGISTRY_USER/${CI_PROJECT_NAME}:latest -deploy:debian: +deploy:apt: # doc: https://git.collinwebdesigns.de/help/user/packages/debian_repository/index.md#install-a-package image: debian:bookworm-slim stage: deploy diff --git a/PKGBUILD b/PKGBUILD index 07b34e9..1dd571c 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -7,7 +7,7 @@ arch=('any') # x86_64? url="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls" #license=('MIT') depends=('python3' 'python-fastapi' 'uvicorn' 'python-dotenv' 'python-dateutil' 'python-jose' 'python-sqlalchemy' 'python-pycryptodome' 'python-markdown' 'openssl') -source=(".") # 'README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py' +source=('README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py') sha512sums=("SKIP") package() { From f04d4905dfd26e2458623158215545e5eea88be5 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 21:13:20 +0100 Subject: [PATCH 08/11] applied changes from samicrusader --- .gitlab-ci.yml | 6 +---- PKGBUILD | 55 ++++++++++++++++++++++++++++----------------- fastapi-dls.default | 23 +++++++++++++++++++ fastapi-dls.install | 14 ++++++++++++ fastapi-dls.service | 15 +++++++++++++ 5 files changed, 88 insertions(+), 25 deletions(-) create mode 100644 fastapi-dls.default create mode 100644 fastapi-dls.install create mode 100644 fastapi-dls.service diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d57937d..1fde992 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,11 +52,7 @@ build:pamac: - 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - chown -R build:build . script: - - pwd - #- source PKGBUILD && pacman -Syu --noconfirm --needed --asdeps "${makedepends[@]}" "${depends[@]}" - - ls -lah - - ls -lah app/ - - sudo -u build makepkg -si + - sudo -u build makepkg -s test: image: python:3.10-slim-bullseye diff --git a/PKGBUILD b/PKGBUILD index 1dd571c..a70b36e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,27 +1,42 @@ +# Maintainer: samicrusader # Maintainer: Oscar Krause + pkgname=fastapi-dls -pkgver=1.0.0 +pkgver=1.0 pkgrel=1 -pkgdesc="Minimal Delegated License Service (DLS)." -arch=('any') # x86_64? -url="https://git.collinwebdesigns.de/oscar.krause/fastapi-dls" -#license=('MIT') -depends=('python3' 'python-fastapi' 'uvicorn' 'python-dotenv' 'python-dateutil' 'python-jose' 'python-sqlalchemy' 'python-pycryptodome' 'python-markdown' 'openssl') -source=('README.md' 'version.env' 'app/main.py' 'app/orm.py' 'app/util.py') -sha512sums=("SKIP") +pkgdesc='NVIDIA DLS server implementation with FastAPI' +arch=('any') +url='https://git.collinwebdesigns.de/oscar.krause/fastapi-dls' +license=('MIT') +depends=('python' 'python-jose' 'python-starlette' 'python-httpx' 'python-fastapi' 'python-dotenv' 'python-dateutil' 'python-sqlalchemy' 'python-pycryptodome' 'uvicorn' 'python-markdown' 'openssl') +provider=("$pkgname") +install="$pkgname.install" +source=('git+https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git#commit=3d5203dae054020e6f56e5f457fac1fbacc6f05d' # https://gitea.publichub.eu/oscar.krause/fastapi-dls.git + "$pkgname.default" + "$pkgname.service") +sha256sums=('SKIP' + 'd8b2216b67a2f8f35ad6f07c825839794f7c34456a72caadd9fc110810348d90' + '10cb98d64f8bf37b11a60510793c187cc664e63c895d1205781c21fa2e703f32') -package() { - mkdir -p "${pkgdir}/usr/share" - - echo "pkgdir: ${pkgdir}" - echo "srcdir: ${srcdir}" - echo "startDir: ${startDir}" - - cp "${srcdir}/README.md" "${pkgdir}/usr/share/README.md" - cp "${srcdir}/version.env" "${pkgdir}/usr/share/version.env" - cp -r "${srcdir}/app" "${pkgdir}/usr/share" +check() { + cd "$srcdir/$pkgname/test" + mkdir "$srcdir/$pkgname/app/cert" + openssl genrsa -out "$srcdir/$pkgname/app/cert/instance.private.pem" 2048 + openssl rsa -in "$srcdir/$pkgname/app/cert/instance.private.pem" -outform PEM -pubout -out "$srcdir/$pkgname/app/cert/instance.public.pem" + python "$srcdir/$pkgname/test/main.py" + rm -rf "$srcdir/$pkgname/app/cert" } +package() { + install -d "$pkgdir/usr/share/doc/$pkgname" + install -d "$pkgdir/var/lib/$pkgname/cert" + cp -r "$srcdir/$pkgname/doc"/* "$pkgdir/usr/share/doc/$pkgname/" + install -Dm644 "$srcdir/$pkgname/README.md" "$pkgdir/usr/share/doc/$pkgname/README.md" -# https://bbs.archlinux.org/viewtopic.php?id=213287 -# https://itsfoss.com/create-pkgbuild/ + sed -i "s/README.md/\/usr\/share\/doc\/$pkgname\/README.md/g" "$srcdir/$pkgname/app/main.py" + sed -i "s/join(dirname(__file__), 'cert\//join('\/var\/lib\/$pkgname', 'cert\//g" "$srcdir/$pkgname/app/main.py" + install -Dm755 "$srcdir/$pkgname/app/main.py" "$pkgdir/opt/$pkgname/main.py" + install -Dm755 "$srcdir/$pkgname/app/orm.py" "$pkgdir/opt/$pkgname/orm.py" + install -Dm644 "$srcdir/$pkgname.default" "$pkgdir/etc/default/$pkgname" + install -Dm644 "$srcdir/$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service" +} diff --git a/fastapi-dls.default b/fastapi-dls.default new file mode 100644 index 0000000..079679b --- /dev/null +++ b/fastapi-dls.default @@ -0,0 +1,23 @@ +# Toggle FastAPI debug mode +DEBUG=false + +# Where the client can find the DLS server +## DLS_URL should be a hostname +DLS_URL="localhost.localdomain" +DLS_PORT=8443 +CORS_ORIGINS="https://$DLS_URL:$DLS_PORT" + +# Lease expiration in days +LEASE_EXPIRE_DAYS=90 + +# Database location +## See https://dataset.readthedocs.io/en/latest/quickstart.html for details +DATABASE="sqlite:////var/lib/fastapi-dls/db.sqlite" + +# UUIDs for identifying the instance +SITE_KEY_XID="<>" +INSTANCE_REF="<>" + +# Site-wide signing keys +INSTANCE_KEY_RSA="/var/lib/fastapi-dls/instance.private.pem" +INSTANCE_KEY_PUB="/var/lib/fastapi-dls/instance.public.pem" diff --git a/fastapi-dls.install b/fastapi-dls.install new file mode 100644 index 0000000..17ad880 --- /dev/null +++ b/fastapi-dls.install @@ -0,0 +1,14 @@ +post_install() { + sed -i "s/<>/$(uuidgen)/" /etc/default/fastapi-dls + sed -i "s/<>/$(uuidgen)/" /etc/default/fastapi-dls + + echo 'The environment variables for this server can be edited at: /etc/default/fastapi-dls' + echo 'The server can be started with: systemctl start fastapi-dls.service' + echo + echo 'A valid HTTPS certificate needs to be installed to /var/lib/fastapi-dls/cert/webserver.{crt,key}' + echo 'A self-signed certificate can be generated with: openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /var/lib/fastapi-dls/cert/webserver.key -out /var/lib/fastapi-dls/cert/webserver.crt' + echo + echo 'The signing keys for your instance need to be generated as well. Generate them with these commands:' + echo 'openssl genrsa -out /var/lib/fastapi-dls/instance.private.pem 2048' + echo 'openssl rsa -in /var/lib/fastapi-dls/instance.private.pem -outform PEM -pubout -out /var/lib/fastapi-dls/instance.public.pem' +} diff --git a/fastapi-dls.service b/fastapi-dls.service new file mode 100644 index 0000000..1bca7b7 --- /dev/null +++ b/fastapi-dls.service @@ -0,0 +1,15 @@ +[Unit] +Description=FastAPI-DLS +Documentation=https://git.collinwebdesigns.de/oscar.krause/fastapi-dls +After=network.target + +[Service] +Type=forking +EnvironmentFile=/etc/default/fastapi-dls +ExecStart=/usr/bin/python /opt/fastapi-dls/main.py +WorkingDir=/opt/fastapi-dls +Restart=on-abort +User=root + +[Install] +WantedBy=multi-user.target From 571e654af15da0f776baab1ced9519ba068e54e4 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 21:14:14 +0100 Subject: [PATCH 09/11] fixes --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fde992..ec85d6b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,6 +52,9 @@ build:pamac: - 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - chown -R build:build . script: + # download dependencies + - source PKGBUILD && pacman -Syu --noconfirm --needed --asdeps "${makedepends[@]}" "${depends[@]}" + # build - sudo -u build makepkg -s test: From abb56be3bb78553b42fb383b1691bb0f992592ca Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 21:15:32 +0100 Subject: [PATCH 10/11] added git --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ec85d6b..8ffad3e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,6 +47,7 @@ build:pamac: rules: - if: $CI_COMMIT_BRANCH == "archlinux-makepkg" before_script: + - pacman -Syu --noconfirm git - useradd --no-create-home --shell=/bin/false build && usermod -L build - 'echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' From a02d1ab9dff3791df17b53abf0796119246ea954 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 28 Dec 2022 21:20:19 +0100 Subject: [PATCH 11/11] .gitlab-ci.yml - handle artifact --- PKGBUILD => .PKGBUILD/PKGBUILD | 2 +- fastapi-dls.default => .PKGBUILD/fastapi-dls.default | 0 fastapi-dls.install => .PKGBUILD/fastapi-dls.install | 0 fastapi-dls.service => .PKGBUILD/fastapi-dls.service | 0 .gitlab-ci.yml | 9 ++++++++- 5 files changed, 9 insertions(+), 2 deletions(-) rename PKGBUILD => .PKGBUILD/PKGBUILD (91%) rename fastapi-dls.default => .PKGBUILD/fastapi-dls.default (100%) rename fastapi-dls.install => .PKGBUILD/fastapi-dls.install (100%) rename fastapi-dls.service => .PKGBUILD/fastapi-dls.service (100%) diff --git a/PKGBUILD b/.PKGBUILD/PKGBUILD similarity index 91% rename from PKGBUILD rename to .PKGBUILD/PKGBUILD index a70b36e..3a2fac0 100644 --- a/PKGBUILD +++ b/.PKGBUILD/PKGBUILD @@ -11,7 +11,7 @@ license=('MIT') depends=('python' 'python-jose' 'python-starlette' 'python-httpx' 'python-fastapi' 'python-dotenv' 'python-dateutil' 'python-sqlalchemy' 'python-pycryptodome' 'uvicorn' 'python-markdown' 'openssl') provider=("$pkgname") install="$pkgname.install" -source=('git+https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git#commit=3d5203dae054020e6f56e5f457fac1fbacc6f05d' # https://gitea.publichub.eu/oscar.krause/fastapi-dls.git +source=('git+file:///builds/oscar.krause/fastapi-dls' # https://gitea.publichub.eu/oscar.krause/fastapi-dls.git "$pkgname.default" "$pkgname.service") sha256sums=('SKIP' diff --git a/fastapi-dls.default b/.PKGBUILD/fastapi-dls.default similarity index 100% rename from fastapi-dls.default rename to .PKGBUILD/fastapi-dls.default diff --git a/fastapi-dls.install b/.PKGBUILD/fastapi-dls.install similarity index 100% rename from fastapi-dls.install rename to .PKGBUILD/fastapi-dls.install diff --git a/fastapi-dls.service b/.PKGBUILD/fastapi-dls.service similarity index 100% rename from fastapi-dls.service rename to .PKGBUILD/fastapi-dls.service diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8ffad3e..ebf8150 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,6 @@ build:apt: stage: build before_script: - apt-get update -qq && apt-get install -qq -y build-essential - - chmod 0755 -R . # create build directory for .deb sources - mkdir build # copy install instructions @@ -48,15 +47,23 @@ build:pamac: - if: $CI_COMMIT_BRANCH == "archlinux-makepkg" before_script: - pacman -Syu --noconfirm git + # "makepkg" don't likes root user - useradd --no-create-home --shell=/bin/false build && usermod -L build - 'echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - 'echo "root ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers' - chown -R build:build . + # move .PKGBUILD contents to root directory + - mv .PKGBUILD/* . script: + - pwd # download dependencies - source PKGBUILD && pacman -Syu --noconfirm --needed --asdeps "${makedepends[@]}" "${depends[@]}" # build - sudo -u build makepkg -s + artifacts: + expire_in: 1 week + paths: + - "*.pkg.tar.zst" test: image: python:3.10-slim-bullseye