aboutsummaryrefslogtreecommitdiff
path: root/test/formatters/build-image.bash
diff options
context:
space:
mode:
authorRadon Rosborough <radon@intuitiveexplanations.com>2023-10-06 22:01:38 -0700
committerGitHub <noreply@github.com>2023-10-06 22:01:38 -0700
commit791346cd3a331b7a6b949c69e7680f8dc389d3a3 (patch)
treea4bcc4f8423f4e9e67f41643bb4128630aa30ad1 /test/formatters/build-image.bash
parent35f72f6fbe42115202a43be61a07805b3854b0d2 (diff)
Fix brittany formatter & misc improvements (#222)
* Fix brittany installation, needed the `--reorder-goals` argument to be added so that a version that was not the latest version could be installed so that it was compatible with the base lib version shipped with Ubuntu 20.04. We'll upgrade to 22.04 eventually (before it falls out of LTS). Ref: https://github.com/radian-software/apheleia/pull/221 * Add a `make fmt-build-common` target which allows tagging a docker image containing just the base software and not any formatters, to make it easy to debug formatter installation manually. * Update `apheleia-ft` to also run formatter tests when any files affecting a formatter are changed, which includes the installation script, the sample input/output, and also any scripts (e.g. `apheleia-phpcs`) that it uses. We don't have any logic that will run all formatter tests at once, because that is unwieldy. That can be done manually if making a big change. * Update to actions/checkout@v4 from v2 because the older one was listed as deprecated. * Print full stacktraces when `apheleia-ft` fails with an Elisp error.
Diffstat (limited to 'test/formatters/build-image.bash')
-rwxr-xr-xtest/formatters/build-image.bash11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/formatters/build-image.bash b/test/formatters/build-image.bash
index a118d12..2753ba9 100755
--- a/test/formatters/build-image.bash
+++ b/test/formatters/build-image.bash
@@ -4,7 +4,9 @@ set -euo pipefail
echo >&2 "build-image.bash: tagging apheleia-formatters:${TAG:-latest}"
-if [[ -n "${FORMATTERS:-}" ]]; then
+if [[ "${COMMON}" == "1" ]]; then
+ echo "build-image.bash: will tag common base image only"
+elif [[ -n "${FORMATTERS:-}" ]]; then
echo "build-image.bash: will install these formatters: ${FORMATTERS}"
else
echo "build-image.bash: will install all formatters by default"
@@ -17,6 +19,11 @@ if [[ "$OSTYPE" != darwin* ]] && [[ "$EUID" != 0 ]]; then
docker=(sudo -E "${docker[@]}")
fi
-exec "${docker[@]}" build . \
+args=()
+if [[ "${COMMON}" == "1" ]]; then
+ args+=(--target=common)
+fi
+
+exec "${docker[@]}" build . "${args[@]}" \
-t "apheleia-formatters:${TAG:-latest}" \
--build-arg "FORMATTERS=${FORMATTERS:-}"