70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
package:
|
|
name: apcupsd-client-build
|
|
version: 1.0.0
|
|
epoch: 0
|
|
description: Build stage for apcupsd-client (not installed directly)
|
|
copyright:
|
|
- license: MIT
|
|
|
|
environment:
|
|
contents:
|
|
repositories:
|
|
- https://dl-cdn.alpinelinux.org/alpine/v3.21/main
|
|
- https://dl-cdn.alpinelinux.org/alpine/v3.21/community
|
|
packages:
|
|
- alpine-baselayout
|
|
- busybox
|
|
- python3
|
|
- py3-pip
|
|
- py3-virtualenv
|
|
|
|
pipeline:
|
|
- name: Create virtualenv and install dependencies
|
|
runs: |
|
|
set -ex
|
|
mkdir -p "${{targets.destdir}}/app"
|
|
python3 -m virtualenv "${{targets.destdir}}/app/.venv"
|
|
"${{targets.destdir}}/app/.venv/bin/pip" install \
|
|
--no-cache-dir \
|
|
--only-binary :all: \
|
|
-r requirements.prod.txt
|
|
|
|
- name: Copy application source
|
|
runs: |
|
|
set -ex
|
|
cp -r app/ "${{targets.destdir}}/app/app/"
|
|
|
|
- name: Fix virtualenv shebangs
|
|
runs: |
|
|
set -ex
|
|
find "${{targets.destdir}}/app/.venv/bin" -type f -exec \
|
|
sed -i "s|${{targets.destdir}}||g" {} +
|
|
|
|
- name: Strip build artifacts from virtualenv
|
|
runs: |
|
|
set -ex
|
|
rm -rf "${{targets.destdir}}/app/.venv/bin/pip"*
|
|
rm -rf "${{targets.destdir}}/app/.venv/bin/wheel"*
|
|
rm -rf "${{targets.destdir}}/app/.venv/lib/python*/site-packages/pip"
|
|
rm -rf "${{targets.destdir}}/app/.venv/lib/python*/site-packages/pip-*"
|
|
rm -rf "${{targets.destdir}}/app/.venv/lib/python*/site-packages/setuptools"
|
|
rm -rf "${{targets.destdir}}/app/.venv/lib/python*/site-packages/setuptools-*"
|
|
rm -rf "${{targets.destdir}}/app/.venv/lib/python*/site-packages/wheel"
|
|
rm -rf "${{targets.destdir}}/app/.venv/lib/python*/site-packages/wheel-*"
|
|
find "${{targets.destdir}}/app/.venv" -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
|
|
find "${{targets.destdir}}/app/.venv" -name "*.pyc" -delete 2>/dev/null || true
|
|
|
|
subpackages:
|
|
- name: apcupsd-client
|
|
description: FastAPI + Redis UPS monitoring dashboard
|
|
options:
|
|
no-depends: true
|
|
dependencies:
|
|
runtime:
|
|
- python3
|
|
pipeline:
|
|
- runs: |
|
|
set -ex
|
|
mkdir -p "${{targets.subpkgdir}}"
|
|
mv "${{targets.destdir}}/app" "${{targets.subpkgdir}}/app"
|