Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
debian: add Dockerfile and docs for building debian package from source
✗ CI failure Sebastian Martinez committed 10 months ago
commit 71ef1889bfaaf71571c1d3c4d322899050a70c2f
parent 85ddcace0a9fc888aa05bc0e8519ecf8b8a63911
1 failed (1 total) View logs
4 files changed +93 -3
added debian/Dockerfile
@@ -0,0 +1,21 @@
+
FROM rust:1.85-bookworm
+

+
RUN apt-get update && apt-get install -y \
+
    asciidoctor \
+
    build-essential \
+
    debhelper \
+
    dpkg-dev \
+
    git \
+
    lintian \
+
    reprepro \
+
    sqop
+

+
WORKDIR /app
+
RUN mkdir -p /app/keys /app/heartwood /app/output
+

+
ENV APT_REPO_URL="https://iris.radicle.xyz/z2nDKoCF4hg6xVrv7v93LmWHDJKUr.git"
+

+
COPY entrypoint.sh /app/
+
RUN chmod +x /app/entrypoint.sh
+

+
ENTRYPOINT ["/app/entrypoint.sh"]
added debian/README.md
@@ -0,0 +1,35 @@
+
# Packaging for Debian
+

+
To build a Debian package for the heartwood binaries from source, you can either make use of the provided Dockerfile, which includes all necessary dependencies.
+

+
## Docker
+

+
For Docker you need to provide 3 paths that link to the following:
+

+
- Path to the OpenPGP key you created, [signing key setup](key-setup)
+
- Path to the heartwood working copy directory
+
- Path where the final `radicle-apt-repo` pool and dists folder should be copied to.
+

+
```shell
+
$ docker build -t debian-pkg ./debian
+
$ docker run --rm -v <path to apt signing key>:/app/keys/signing-key -v <path to heartwood working copy directory>:/app/heartwood -v <path for storing new pool and dists folder>:/app/output debian-pkg
+
```
+

+
# Manual installation
+

+
You can also manually build the Debian package on a Debian machine by following these steps:
+

+
- Install the necessary dependencies:
+

+
  ```shell
+
  $ sudo apt-get update
+
  $ sudo apt-get install asciidoctor build-essential curl debhelper dpkg-dev git lintian reprepro sqop
+
  ```
+

+
- Build the Debian package:
+

+
  ```shell
+
  $ ./debian/build-deb
+
  ```
+

+
[key-setup]: https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad%3Az2nDKoCF4hg6xVrv7v93LmWHDJKUr#signing-key-setup
added debian/entrypoint.sh
@@ -0,0 +1,30 @@
+
#!/bin/bash
+
set -e
+

+
if [ ! -f "/app/keys/signing-key" ]; then
+
  echo "Error: OpenPGP signing key not found at /app/keys/signing-key"
+
  echo "Please mount your signing key using: -v /path/to/your/key:/app/keys/signing-key"
+
  exit 1
+
fi
+

+
echo 'Building Debian package...'
+
cd /app/heartwood
+
./debian/build-deb
+
cd ..
+

+
echo 'Cloning radicle-apt-repo...'
+
git clone $APT_REPO_URL radicle-apt-repo
+

+
echo 'Importing package into repository...'
+
cd radicle-apt-repo
+
files=($(find ../ -name "radicle_*.deb" -type f -maxdepth 1))
+
echo "deb packages found:"
+
printf '%s\n' "${files[@]}"
+

+
for file in "${files[@]}"; do
+
    RADICLE_APT_SIGNING_KEY="/app/keys/signing-key" ./import-deb $file
+
done
+

+
echo 'Copying repository files to output directory...'
+
cp -r dists pool /app/output/
+
cp -r conf /app/output/
modified debian/rules
@@ -7,14 +7,18 @@ export GIT_HEAD=$(shell git rev-parse HEAD)
%:
	dh $@

+
clean:
+
	cargo clean
+
	find . -name "target" -type d -exec rm -rf {} \;
+

override_dh_auto_build:
	scripts/build-man-pages.sh . *.adoc

override_dh_auto_install:
	mkdir -p debian/radicle/usr
-
	cargo install --offline --locked --path=crates/radicle-cli --root=debian/radicle/usr
-
	cargo install --offline --locked --path=crates/radicle-node --root=debian/radicle/usr
-
	cargo install --offline --locked --path=crates/radicle-remote-helper --root=debian/radicle/usr
+
	cargo install --locked --path=crates/radicle-cli --root=debian/radicle/usr
+
	cargo install --locked --path=crates/radicle-node --root=debian/radicle/usr
+
	cargo install --locked --path=crates/radicle-remote-helper --root=debian/radicle/usr
	find debian/radicle -name '.crates*' -delete

override_dh_auto_test: