Skip to content

Commit f37c362

Browse files
authored
tools: use simpler packaging by default (#7928)
Feedback from SRE was to just go straight to the new packaging. Also, fix the Architecture field of the .deb to be amd64 (Debian requires this specific value), and check that we are building on x86_64 OR amd64.
1 parent 635f432 commit f37c362

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

tools/make-assets.sh

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,36 @@
11
#!/usr/bin/env bash
22
#
3-
# This script expects to run on Ubuntu. It installs the dependencies necessary
4-
# to build Boulder and produce a Debian Package. The actual build and packaging
5-
# is handled by a call to Make.
3+
# Build Boulder and produce a .deb and a .tar.gz.
4+
#
5+
# This script expects to run on Ubuntu, as configured on GitHub Actions runners
6+
# (with curl, make, and git installed).
67
#
7-
88
# -e Stops execution in the instance of a command or pipeline error.
99
# -u Treat unset variables as an error and exit immediately.
1010
set -eu
1111

12-
#
13-
# Setup Dependencies
14-
#
15-
16-
sudo apt-get install -y --no-install-recommends \
17-
ruby \
18-
ruby-dev \
19-
gcc
12+
ARCH="$(uname -m)"
13+
if [ "${ARCH}" != "x86_64" && "${ARCH}" != "amd64" ]; then
14+
echo "Expected ARCH=x86_64 or amd64, got ${ARCH}"
15+
exit 1
16+
fi
2017

2118
# Download and unpack our production go version. Ensure that $GO_VERSION is
2219
# already set in the environment (e.g. by the github actions release workflow).
2320
$(dirname -- "${0}")/fetch-and-verify-go.sh "${GO_VERSION}"
2421
sudo tar -C /usr/local -xzf go.tar.gz
2522
export PATH=/usr/local/go/bin:$PATH
2623

27-
# Install fpm. This is used in our Makefile to package Boulder as a deb.
28-
# We install specific versions of some dependencies because these are the last versions
29-
# supported by the Ruby / RubyGems that ships on ubuntu-20.04, which this script runs on in CI.
30-
sudo gem install --no-document -v 1.8.0 rchardet
31-
sudo gem install --no-document -v 5.1.1 public_suffix
32-
sudo gem install --no-document -v 2.8.1 dotenv
33-
sudo gem install --no-document -v 1.14.0 fpm
34-
3524
#
3625
# Build
3726
#
3827

39-
# Set $ARCHIVEDIR to our current directory. If left unset our Makefile will set
40-
# it to /tmp.
41-
export ARCHIVEDIR="${PWD}"
42-
4328
# Set $VERSION to be a simulacrum of what is set in other build environments.
44-
export VERSION="${GO_VERSION}.$(date +%s)"
29+
VERSION="${GO_VERSION}.$(date +%s)"
4530

4631
# Build Boulder.
4732
make
4833

49-
# Produce a .deb and a tar.gz file in $PWD.
50-
make deb tar
51-
5234
# Produce a .deb and .tar.gz in $PWD without using `make` or `fpm`. The
5335
# resulting files will be named `boulder-newpkg-*`. Eventually this code
5436
# will be used to produce the regular `boulder-*` packages.
@@ -77,13 +59,13 @@ Package: boulder
7759
Version: 1:${VERSION}
7860
License: Mozilla Public License v2.0
7961
Vendor: ISRG
80-
Architecture: arm64
62+
Architecture: amd64
8163
Maintainer: Community
8264
Section: default
8365
Priority: extra
8466
Homepage: https://github.com/letsencrypt/boulder
8567
Description: Boulder is an ACME-compatible X.509 Certificate Authority
8668
EOF
8769

88-
dpkg-deb -Zgzip -b "${BUILD}" "${ARCHIVEDIR}/boulder-newpkg-${VERSION}-${COMMIT_ID}.x86_64.deb"
89-
tar -C "${TARGET}" -cpzf "${ARCHIVEDIR}/boulder-newpkg-${VERSION}-${COMMIT_ID}.amd64.tar.gz" .
70+
dpkg-deb -Zgzip -b "${BUILD}" "./boulder-${VERSION}-${COMMIT_ID}.x86_64.deb"
71+
tar -C "${TARGET}" -cpzf "./boulder-${VERSION}-${COMMIT_ID}.amd64.tar.gz" .

0 commit comments

Comments
 (0)