Did stuff
This commit is contained in:
parent
650663be78
commit
568d10dc92
4 changed files with 114 additions and 27 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,3 +5,4 @@ build/
|
|||
|
||||
.coverage
|
||||
coverage.xml
|
||||
|
||||
|
|
|
|||
52
Containerfile
Normal file
52
Containerfile
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# Koji-OSBuild Integration Container
|
||||
# Optimized for integration performance between koji and osbuild
|
||||
|
||||
FROM debian:trixie-slim
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
python3-dev \
|
||||
python3-psycopg2 \
|
||||
ca-certificates \
|
||||
curl \
|
||||
postgresql-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install koji-osbuild from the local source
|
||||
COPY . /tmp/koji-osbuild
|
||||
RUN cd /tmp/koji-osbuild && \
|
||||
python3 -m pip install --no-cache-dir -e . && \
|
||||
rm -rf /tmp/koji-osbuild
|
||||
|
||||
# Create non-root user for security
|
||||
RUN useradd -r -s /bin/bash -u 1000 koji-osbuild
|
||||
|
||||
# Set up directories
|
||||
RUN mkdir -p /var/lib/koji-osbuild /var/log/koji-osbuild /etc/koji-osbuild && \
|
||||
chown -R koji-osbuild:koji-osbuild /var/lib/koji-osbuild /var/log/koji-osbuild /etc/koji-osbuild
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /var/lib/koji-osbuild
|
||||
|
||||
# Switch to non-root user
|
||||
USER koji-osbuild
|
||||
|
||||
# Expose koji-osbuild port
|
||||
EXPOSE 8080
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD python3 -c "import koji_osbuild; print('Koji-OSBuild available')" || exit 1
|
||||
|
||||
# Default command - koji-osbuild integration service
|
||||
CMD ["python3", "-m", "koji_osbuild", "--config", "/etc/koji-osbuild/koji-osbuild.conf"]
|
||||
|
||||
# Labels for container management
|
||||
LABEL org.opencontainers.image.title="Koji-OSBuild Integration"
|
||||
LABEL org.opencontainers.image.description="Koji-OSBuild - Integration layer between koji and osbuild"
|
||||
LABEL org.opencontainers.image.vendor="Debian Forge Team"
|
||||
LABEL org.opencontainers.image.source="https://git.raines.xyz/particle-os/koji-osbuild"
|
||||
33
debian-koji-osbuild.conf
Normal file
33
debian-koji-osbuild.conf
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
[composer]
|
||||
# Debian Forge Composer integration
|
||||
server = https://debian-forge-composer.local:8080
|
||||
|
||||
# SSL configuration for secure communication
|
||||
ssl_cert = /etc/debian-koji/ssl/debian-koji.crt
|
||||
ssl_key = /etc/debian-koji/ssl/debian-koji.key
|
||||
ssl_verify = /etc/debian-koji/ssl/debian-forge-ca.pem
|
||||
|
||||
# Debian-specific composer settings
|
||||
debian_archive = https://deb.debian.org/debian
|
||||
debian_security = https://deb.debian.org/debian-security
|
||||
debian_backports = https://deb.debian.org/debian-backports
|
||||
|
||||
[koji]
|
||||
# Debian Koji hub integration
|
||||
server = https://debian-koji.local/kojihub
|
||||
|
||||
# Debian-specific koji settings
|
||||
debian_build_tags = [bookworm, sid, testing, backports]
|
||||
debian_architectures = [amd64, arm64, riscv64]
|
||||
|
||||
[debian]
|
||||
# Debian package management settings
|
||||
package_manager = apt
|
||||
build_tools = sbuild,pbuilder
|
||||
repository_format = deb
|
||||
signing_key = /etc/debian-koji/keys/debian-koji.gpg
|
||||
|
||||
# OSTree and atomic support
|
||||
ostree_enabled = true
|
||||
bootc_support = true
|
||||
atomic_variants = [minimal, server, desktop, development]
|
||||
55
meson.build
55
meson.build
|
|
@ -18,12 +18,11 @@ install_data(
|
|||
git = find_program('git')
|
||||
gitres = run_command(
|
||||
git,
|
||||
['--git-dir=@0@/.git'.format(srcdir), 'rev-parse', 'HEAD'],
|
||||
check=True
|
||||
['--git-dir=' + srcdir + '/.git', 'rev-parse', 'HEAD']
|
||||
)
|
||||
commit = gitres.stdout().strip()
|
||||
|
||||
archive_name = meson.project_name() + '-' + gitrev
|
||||
archive_name = meson.project_name() + '-' + commit
|
||||
full_archive_name = archive_name + '.tar.gz'
|
||||
archive = custom_target(
|
||||
'tarball',
|
||||
|
|
@ -52,31 +51,33 @@ rpmdirs_target = custom_target(
|
|||
|
||||
rpmbuild = find_program('rpmbuild', required: false)
|
||||
|
||||
srpm_target = custom_target(
|
||||
'srpm',
|
||||
command: [
|
||||
rpmbuild, '-bs',
|
||||
spec_file,
|
||||
'--define', '_sourcedir ' + meson.build_root(),
|
||||
'--define', '_topdir ' + rpmdirs_target.full_path(),
|
||||
'--define', 'commit ' + commit
|
||||
],
|
||||
output: 'srpms',
|
||||
depends: [archive]
|
||||
)
|
||||
if rpmbuild.found()
|
||||
srpm_target = custom_target(
|
||||
'srpm',
|
||||
command: [
|
||||
rpmbuild, '-bs',
|
||||
'koji-osbuild.spec',
|
||||
'--define', '_sourcedir ' + meson.build_root(),
|
||||
'--define', '_topdir ' + rpmdirs_target.full_path(),
|
||||
'--define', 'commit ' + commit
|
||||
],
|
||||
output: 'srpms',
|
||||
depends: [archive]
|
||||
)
|
||||
|
||||
rpm_target = custom_target(
|
||||
'rpm',
|
||||
command: [
|
||||
rpmbuild, '-ba',
|
||||
spec_file,
|
||||
'--define', '_sourcedir ' + meson.build_root(),
|
||||
'--define', '_topdir ' + rpmdirs_target.full_path(),
|
||||
'--define', 'commit ' + commit
|
||||
],
|
||||
output: 'rpms',
|
||||
depends: [archive]
|
||||
)
|
||||
rpm_target = custom_target(
|
||||
'rpm',
|
||||
command: [
|
||||
rpmbuild, '-ba',
|
||||
'koji-osbuild.spec',
|
||||
'--define', '_sourcedir ' + meson.build_root(),
|
||||
'--define', '_topdir ' + rpmdirs_target.full_path(),
|
||||
'--define', 'commit ' + commit
|
||||
],
|
||||
output: 'rpms',
|
||||
depends: [archive]
|
||||
)
|
||||
endif
|
||||
|
||||
msg = ['',
|
||||
'hub plugins path: @0@'.format(hub_plugins_path),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue