|
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 | 11 | cd "$(realpath -- "$(dirname -- "$0")")/.." |
12 | 12 |
|
13 | | -BUILD="$(mktemp -d)" |
| 13 | +if [ -z "${VERSION:-}" ]; then echo "VERSION not set"; exit 1; fi |
| 14 | +if [ -z "${COMMIT_ID:-}" ]; then echo "COMMIT_ID not set"; exit 1; fi |
| 15 | +if [ -z "${ARCH:-}" ]; then echo "ARCH not set"; exit 1; fi |
14 | 16 |
|
| 17 | +BUILD="$(mktemp -d)" |
15 | 18 | mkdir -p "${BUILD}/opt" |
16 | 19 | cp -a /opt/boulder "${BUILD}/opt/boulder" |
17 | 20 |
|
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 | 21 | mkdir -p "${BUILD}/DEBIAN" |
30 | | -cat > "${BUILD}/DEBIAN/control" <<-EOF |
| 22 | +cat >"${BUILD}/DEBIAN/control" <<-EOF |
31 | 23 | Package: boulder |
32 | 24 | Version: 1:${VERSION} |
33 | 25 | License: Mozilla Public License v2.0 |
34 | 26 | Vendor: ISRG |
35 | | -Architecture: ${DEB_ARCH} |
| 27 | +Architecture: ${ARCH} |
36 | 28 | Maintainer: Community |
37 | 29 | Section: default |
38 | 30 | Priority: extra |
39 | 31 | Homepage: https://github.com/letsencrypt/boulder |
40 | 32 | Description: Boulder is an ACME-compatible X.509 Certificate Authority |
41 | 33 | EOF |
42 | 34 |
|
43 | | -dpkg-deb -Zgzip -b "${BUILD}" "boulder-${VERSION}-${COMMIT_ID}.${DEB_ARCH}.deb" |
| 35 | +dpkg-deb -Zgzip -b "${BUILD}" "boulder-${VERSION}-${COMMIT_ID}.${ARCH}.deb" |
0 commit comments