Skip to content

Commit 61dc672

Browse files
committed
Arch Linux: build and test package in Docker container
Add a --test option to update-aur.sh which runs 'makepkg'. (With --docker, it runs 'makepkg' inside a Docker container.) This simplifies the release process.
1 parent b4b4e6f commit 61dc672

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

dist/arch/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
FROM archlinux:base
55

6-
RUN pacman --sync --refresh --noconfirm binutils pacman-contrib
6+
RUN pacman --sync --refresh --noconfirm binutils pacman-contrib sudo
77

8-
RUN useradd --create-home --shell /bin/sh qljs-builder
8+
RUN useradd --create-home --shell /bin/sh qljs-builder && \
9+
printf 'qljs-builder ALL=(ALL) NOPASSWD: ALL\n' >/etc/sudoers.d/qljs-builder
910
USER qljs-builder
1011

1112
# quick-lint-js finds bugs in JavaScript programs.

dist/arch/update-aur.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ set -u
99
here="$(cd "$(dirname "${0}")" && pwd)"
1010

1111
print_usage() {
12-
printf 'usage: %s [--docker] /path/to/quick-lint-js-aur\n' "${0}"
12+
printf 'usage: %s [--docker] [--test] /path/to/quick-lint-js-aur\n' "${0}"
1313
}
1414

1515
docker=0
16+
test=0
1617
qljsaur=
1718

18-
docker_image=ghcr.io/quick-lint/quick-lint-js-dist-arch:v1
19+
docker_image=ghcr.io/quick-lint/quick-lint-js-dist-arch:v2
1920

2021
while [ "${#}" -ne 0 ]; do
2122
case "${1}" in
2223
--docker) docker=1 ;;
24+
--test) test=1 ;;
2325
-*)
2426
printf 'error: invalid option: %s\n' "${1}"
2527
print_usage >&2
@@ -42,8 +44,14 @@ script="
4244
updpkgsums PKGBUILD
4345
makepkg --printsrcinfo PKGBUILD >.SRCINFO
4446
"
47+
if [ "${test}" -eq 1 ]; then
48+
script="${script}
49+
makepkg --install --force --syncdeps --noconfirm
50+
"
51+
fi
52+
4553
if [ "${docker}" -eq 1 ]; then
46-
docker run -t --mount type=bind,source="${qljsaur}",destination=/qljs-aur "${docker_image}" sh -c "
54+
docker run --interactive --tty --mount type=bind,source="${qljsaur}",destination=/qljs-aur "${docker_image}" sh -c "
4755
set -e
4856
set -u
4957
cd /qljs-aur

docs/RELEASE.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ Follow the following steps to release a new version of quick-lint-js:
5555
12. Update Arch Linux user repositories (AUR):
5656
1. Clone ssh://[email protected]/quick-lint-js with Git.
5757
2. Update README to point to the tag's commit.
58-
3. Run `dist/arch/update-aur.sh --docker /path/to/quick-lint-js-aur-clone`.
58+
3. Run `dist/arch/update-aur.sh --docker --test /path/to/quick-lint-js-aur-clone`.
5959
4. Commit all files with message "Update quick-lint-js to version
6060
VERSION_NUMBER".
61-
5. On an Arch Linux machine, cd into the quick-lint-js AUR clone and run
62-
`makepkg -si` to test your changes.
63-
6. Push to the `master` branch on AUR.
61+
5. Push to the `master` branch on AUR.

0 commit comments

Comments
 (0)