|
1 | 1 | #!/usr/bin/env bash
|
2 | 2 | #
|
3 |
| -# Produce a .deb from a built Boulder plus helper files. |
| 3 | +# Produce a .deb package from a built Boulder container. |
4 | 4 | #
|
5 |
| -# This script expects to run on Ubuntu, as configured on GitHub Actions runners |
6 |
| -# (with curl, make, and git installed). |
| 5 | +# This script is executed inside the Boulder Docker container by container-build.sh. |
| 6 | +# It packages the Boulder binary and assets into a Debian package for distribution. |
7 | 7 | #
|
8 | 8 | # -e Stops execution in the instance of a command or pipeline error.
|
9 | 9 | # -u Treat unset variables as an error and exit immediately.
|
10 | 10 | set -eu
|
11 |
| -cd "$(realpath -- "$(dirname -- "$0")")/.." |
12 | 11 |
|
13 |
| -BUILD="$(mktemp -d)" |
| 12 | +if [ -z "${VERSION:-}" ]; then echo "VERSION not set"; exit 1; fi |
| 13 | +if [ -z "${COMMIT_ID:-}" ]; then echo "COMMIT_ID not set"; exit 1; fi |
| 14 | +if [ -z "${ARCH:-}" ]; then echo "ARCH not set"; exit 1; fi |
14 | 15 |
|
| 16 | +BUILD="$(mktemp -d)" |
15 | 17 | mkdir -p "${BUILD}/opt"
|
16 | 18 | cp -a /opt/boulder "${BUILD}/opt/boulder"
|
17 | 19 |
|
18 |
| -# Determine architecture - use ARCH env var if set, otherwise detect from uname |
19 |
| -if [ -n "${ARCH:-}" ]; then |
20 |
| - DEB_ARCH="${ARCH}" |
21 |
| -else |
22 |
| - case "$(uname -m)" in |
23 |
| - "x86_64") DEB_ARCH="amd64" ;; |
24 |
| - "aarch64"|"arm64") DEB_ARCH="arm64" ;; |
25 |
| - *) echo "Unsupported architecture: $(uname -m)" && exit 1 ;; |
26 |
| - esac |
27 |
| -fi |
28 |
| - |
29 | 20 | mkdir -p "${BUILD}/DEBIAN"
|
30 |
| -cat > "${BUILD}/DEBIAN/control" <<-EOF |
| 21 | +cat >"${BUILD}/DEBIAN/control" <<-EOF |
31 | 22 | Package: boulder
|
32 | 23 | Version: 1:${VERSION}
|
33 | 24 | License: Mozilla Public License v2.0
|
34 | 25 | Vendor: ISRG
|
35 |
| -Architecture: ${DEB_ARCH} |
| 26 | +Architecture: ${ARCH} |
36 | 27 | Maintainer: Community
|
37 | 28 | Section: default
|
38 | 29 | Priority: extra
|
39 | 30 | Homepage: https://github.com/letsencrypt/boulder
|
40 | 31 | Description: Boulder is an ACME-compatible X.509 Certificate Authority
|
41 | 32 | EOF
|
42 | 33 |
|
43 |
| -dpkg-deb -Zgzip -b "${BUILD}" "boulder-${VERSION}-${COMMIT_ID}.${DEB_ARCH}.deb" |
| 34 | +dpkg-deb -Zgzip -b "${BUILD}" "boulder-${VERSION}-${COMMIT_ID}.${ARCH}.deb" |
0 commit comments