Compare commits
No commits in common. "2f5a65b737a7f3eb9c8ca76a638de94ff5cdea47" and "d8fb33f0d0d3c1aa75ad1868e1a172a456f52fc5" have entirely different histories.
2f5a65b737
...
d8fb33f0d0
11 changed files with 11 additions and 167 deletions
|
|
@ -25,7 +25,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install project deps (including test extras)
|
- name: Install project deps (including test extras)
|
||||||
run: |
|
run: |
|
||||||
poetry install --with dev
|
poetry install --with test
|
||||||
|
|
||||||
- name: Run test script
|
- name: Run test script
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,3 @@
|
||||||
# 0.0.3
|
|
||||||
|
|
||||||
* various bug fixes
|
|
||||||
* Add debian packaging
|
|
||||||
|
|
||||||
# 0.0.2
|
# 0.0.2
|
||||||
|
|
||||||
* Merge pkg_ and roles created based on file/service detection
|
* Merge pkg_ and roles created based on file/service detection
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
# syntax=docker/dockerfile:1
|
|
||||||
ARG BASE_IMAGE=debian:bookworm
|
|
||||||
FROM ${BASE_IMAGE}
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
# If Ubuntu, ensure Universe is enabled.
|
|
||||||
RUN set -eux; \
|
|
||||||
. /etc/os-release; \
|
|
||||||
if [ "${ID:-}" = "ubuntu" ]; then \
|
|
||||||
apt-get update; \
|
|
||||||
apt-get install -y --no-install-recommends software-properties-common ca-certificates; \
|
|
||||||
add-apt-repository -y universe; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build deps
|
|
||||||
RUN set -eux; \
|
|
||||||
apt-get update; \
|
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
build-essential \
|
|
||||||
devscripts \
|
|
||||||
debhelper \
|
|
||||||
dh-python \
|
|
||||||
pybuild-plugin-pyproject \
|
|
||||||
python3-all \
|
|
||||||
python3-poetry-core \
|
|
||||||
rsync \
|
|
||||||
ca-certificates \
|
|
||||||
; \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Build runner script
|
|
||||||
RUN set -eux; \
|
|
||||||
cat > /usr/local/bin/build-deb <<'EOF'
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
SRC="${SRC:-/src}"
|
|
||||||
WORKROOT="${WORKROOT:-/work}"
|
|
||||||
WORK="${WORKROOT}/src"
|
|
||||||
OUT="${OUT:-/out}"
|
|
||||||
|
|
||||||
mkdir -p "$WORK" "$OUT"
|
|
||||||
|
|
||||||
rsync -a --delete \
|
|
||||||
--exclude '.git' \
|
|
||||||
--exclude '.venv' \
|
|
||||||
--exclude 'dist' \
|
|
||||||
--exclude 'build' \
|
|
||||||
--exclude '__pycache__' \
|
|
||||||
--exclude '.pytest_cache' \
|
|
||||||
--exclude '.mypy_cache' \
|
|
||||||
"${SRC}/" "${WORK}/"
|
|
||||||
|
|
||||||
cd "${WORK}"
|
|
||||||
if [ -n "${SUITE:-}" ]; then
|
|
||||||
export DEBEMAIL="mig@mig5.net"
|
|
||||||
export DEBFULLNAME="Miguel Jacq"
|
|
||||||
|
|
||||||
dch --distribution "$SUITE" --local "~${SUITE}" "CI build for $SUITE"
|
|
||||||
fi
|
|
||||||
dpkg-buildpackage -us -uc -b
|
|
||||||
|
|
||||||
shopt -s nullglob
|
|
||||||
cp -v "${WORKROOT}"/*.deb \
|
|
||||||
"${WORKROOT}"/*.changes \
|
|
||||||
"${WORKROOT}"/*.buildinfo \
|
|
||||||
"${WORKROOT}"/*.dsc \
|
|
||||||
"${WORKROOT}"/*.tar.* \
|
|
||||||
"${OUT}/" || true
|
|
||||||
|
|
||||||
echo "Artifacts copied to ${OUT}"
|
|
||||||
EOF
|
|
||||||
RUN chmod +x /usr/local/bin/build-deb
|
|
||||||
|
|
||||||
WORKDIR /work
|
|
||||||
ENTRYPOINT ["/usr/local/bin/build-deb"]
|
|
||||||
12
README.md
12
README.md
|
|
@ -18,16 +18,6 @@ It aims to be **optimistic and noninteractive**:
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
### Ubuntu/Debian apt repository
|
|
||||||
|
|
||||||
```bash
|
|
||||||
sudo mkdir -p /usr/share/keyrings
|
|
||||||
curl -fsSL https://mig5.net/static/mig5.asc | sudo gpg --dearmor -o /usr/share/keyrings/mig5.gpg
|
|
||||||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/mig5.gpg] https://apt.mig5.net $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mig5.list
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install enroll
|
|
||||||
```
|
|
||||||
|
|
||||||
### AppImage
|
### AppImage
|
||||||
|
|
||||||
Download the AppImage file from the Releases page (verify with GPG if you wish, my fingerprint is [here](https://mig5.net/static/mig5.asc),
|
Download the AppImage file from the Releases page (verify with GPG if you wish, my fingerprint is [here](https://mig5.net/static/mig5.asc),
|
||||||
|
|
@ -38,7 +28,7 @@ chmod +x Enroll.AppImage
|
||||||
./Enroll.AppImage
|
./Enroll.AppImage
|
||||||
```
|
```
|
||||||
|
|
||||||
### Pip/PipX
|
### Pip
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install enroll
|
pip install enroll
|
||||||
|
|
|
||||||
5
debian/changelog
vendored
5
debian/changelog
vendored
|
|
@ -1,5 +0,0 @@
|
||||||
enroll (0.0.2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Initial package
|
|
||||||
|
|
||||||
-- Miguel Jacq <mig@mig5.net> Mon, 15 Dec 2025 12:00:00 +0000
|
|
||||||
19
debian/control
vendored
19
debian/control
vendored
|
|
@ -1,19 +0,0 @@
|
||||||
Source: enroll
|
|
||||||
Section: admin
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Miguel Jacq <mig@mig5.net>
|
|
||||||
Rules-Requires-Root: no
|
|
||||||
Build-Depends:
|
|
||||||
debhelper-compat (= 13),
|
|
||||||
dh-python,
|
|
||||||
pybuild-plugin-pyproject,
|
|
||||||
python3-all,
|
|
||||||
python3-poetry-core
|
|
||||||
Standards-Version: 4.6.2
|
|
||||||
Homepage: https://git.mig5.net/mig5/enroll
|
|
||||||
|
|
||||||
Package: enroll
|
|
||||||
Architecture: all
|
|
||||||
Depends: ${misc:Depends}, ${python3:Depends}
|
|
||||||
Description: Harvest a host into Ansible roles
|
|
||||||
A tool that inspects a system and emits Ansible roles/playbooks to reproduce it.
|
|
||||||
6
debian/rules
vendored
6
debian/rules
vendored
|
|
@ -1,6 +0,0 @@
|
||||||
#!/usr/bin/make -f
|
|
||||||
export PYBUILD_NAME=enroll
|
|
||||||
export PYBUILD_SYSTEM=pyproject
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@ --with python3 --buildsystem=pybuild
|
|
||||||
1
debian/source/format
vendored
1
debian/source/format
vendored
|
|
@ -1 +0,0 @@
|
||||||
3.0 (quilt)
|
|
||||||
6
debian/source/options
vendored
6
debian/source/options
vendored
|
|
@ -1,6 +0,0 @@
|
||||||
tar-ignore = ".git"
|
|
||||||
tar-ignore = ".venv"
|
|
||||||
tar-ignore = "__pycache__"
|
|
||||||
tar-ignore = ".pytest_cache"
|
|
||||||
tar-ignore = "dist"
|
|
||||||
tar-ignore = "build"
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "enroll"
|
name = "enroll"
|
||||||
version = "0.0.3"
|
version = "0.0.2"
|
||||||
description = "Enroll a server's running state retrospectively into Ansible"
|
description = "Enroll a server's running state retrospectively into Ansible"
|
||||||
authors = ["Miguel Jacq <mig@mig5.net>"]
|
authors = ["Miguel Jacq <mig@mig5.net>"]
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
|
|
@ -14,6 +14,14 @@ python = "^3.10"
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
enroll = "enroll.cli:main"
|
enroll = "enroll.cli:main"
|
||||||
|
|
||||||
|
[tool.poetry.group.test.dependencies]
|
||||||
|
pytest = "^9.0.2"
|
||||||
|
pytest-cov = "^7.0.0"
|
||||||
|
|
||||||
|
|
||||||
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
pyproject-appimage = "^4.2"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.8.0"]
|
requires = ["poetry-core>=1.8.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
@ -21,10 +29,3 @@ build-backend = "poetry.core.masonry.api"
|
||||||
[tool.pyproject-appimage]
|
[tool.pyproject-appimage]
|
||||||
script = "enroll"
|
script = "enroll"
|
||||||
output = "Enroll.AppImage"
|
output = "Enroll.AppImage"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
|
||||||
pytest = "^8"
|
|
||||||
pytest-cov = "^5"
|
|
||||||
ansible = "^9"
|
|
||||||
ansible-lint = "^24"
|
|
||||||
pyproject-appimage = "^4.2"
|
|
||||||
|
|
|
||||||
28
release.sh
28
release.sh
|
|
@ -15,31 +15,3 @@ mv Enroll.AppImage dist/
|
||||||
|
|
||||||
# Sign packages
|
# Sign packages
|
||||||
for file in `ls -1 dist/`; do qubes-gpg-client --batch --armor --detach-sign dist/$file > dist/$file.asc; done
|
for file in `ls -1 dist/`; do qubes-gpg-client --batch --armor --detach-sign dist/$file > dist/$file.asc; done
|
||||||
|
|
||||||
# Deb stuff
|
|
||||||
DISTS=(
|
|
||||||
debian:bookworm
|
|
||||||
debian:trixie
|
|
||||||
ubuntu:jammy
|
|
||||||
ubuntu:noble
|
|
||||||
)
|
|
||||||
|
|
||||||
for dist in ${DISTS[@]}; do
|
|
||||||
release=$(echo ${dist} | cut -d: -f2)
|
|
||||||
mkdir -p dist/${release}
|
|
||||||
|
|
||||||
docker build -f Dockerfile.debbuild -t enroll-deb:${release} \
|
|
||||||
--progress=plain \
|
|
||||||
--build-arg BASE_IMAGE=${dist} .
|
|
||||||
|
|
||||||
docker run --rm \
|
|
||||||
-e SUITE="${release}" \
|
|
||||||
-v "$PWD":/src \
|
|
||||||
-v "$PWD/dist/${release}":/out \
|
|
||||||
enroll-deb:${release}
|
|
||||||
|
|
||||||
# rename the file
|
|
||||||
debfile=$(ls -1 dist/${release}/*.deb)
|
|
||||||
|
|
||||||
reprepro -b /home/user/git/repo includedeb "${release}" "${debfile}"
|
|
||||||
done
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue