Merge branch 'archlinux-makepkg' into 'dev'

Archlinux makepkg

See merge request oscar.krause/fastapi-dls!13
This commit is contained in:
Oscar Krause
2022-12-28 21:42:01 +01:00
5 changed files with 123 additions and 6 deletions

View File

@@ -15,13 +15,11 @@ 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:
- 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
@@ -42,6 +40,31 @@ build:package:
paths:
- build/build.deb
build:pamac:
image: archlinux:base-devel
stage: build
rules:
- 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
stage: test
@@ -60,7 +83,7 @@ test:
.test:linux:
stage: test
needs:
- job: build:package
- job: build:apt
artifacts: true
variables:
DEBIAN_FRONTEND: noninteractive
@@ -120,7 +143,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
@@ -130,7 +153,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