Skip to content

Commit 47ea7a0

Browse files
authored
ref: Move jq build to error-handling.sh, and use proxy config (#1895)
This fixes [errors early in the installer run not getting reported correctly](#1884) and [jq's docker build not using the proxy config correctly](#1871)
1 parent 293604a commit 47ea7a0

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

_unit-test/error-handling-test.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ source "$(dirname $0)/_test_setup.sh"
33

44
export REPORT_SELF_HOSTED_ISSUES=1
55

6+
# This is set up in dc-detect-version.sh, but for
7+
# our purposes we don't care about proxies.
8+
dbuild="docker build"
69
source error-handling.sh
710

811
# mock send_envelope
@@ -36,7 +39,7 @@ export dc=':'
3639
echo "Test Logs" >"$log_path"
3740
CLEANUP_RESPONSE=$(cleanup ERROR)
3841
rm "$log_path"
39-
test "$CLEANUP_RESPONSE" == 'Error in ./_unit-test/error-handling-test.sh:37.
42+
test "$CLEANUP_RESPONSE" == 'Error in ./_unit-test/error-handling-test.sh:40.
4043
'\''local cmd="${BASH_COMMAND}"'\'' exited with status 0
4144
4245
Cleaning up...'
@@ -48,7 +51,7 @@ export MINIMIZE_DOWNTIME=1
4851
echo "Test Logs" >"$log_path"
4952
CLEANUP_RESPONSE=$(cleanup ERROR)
5053
rm "$log_path"
51-
test "$CLEANUP_RESPONSE" == 'Error in ./_unit-test/error-handling-test.sh:49.
54+
test "$CLEANUP_RESPONSE" == 'Error in ./_unit-test/error-handling-test.sh:52.
5255
'\''local cmd="${BASH_COMMAND}"'\'' exited with status 0
5356
5457
*NOT* cleaning up, to clean your environment run "docker compose stop".'

install/build-docker-images.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ echo "${_group}Building and tagging Docker images ..."
33
echo ""
44
# Build any service that provides the image sentry-self-hosted-local first,
55
# as it is used as the base image for sentry-cleanup-self-hosted-local.
6-
$dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm web
6+
$dcb --force-rm web
77
for service in "$($dc config --services)"; do
8-
$dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm $service
8+
$dcb --force-rm $service
99
done
10-
# Used in error-handling.sh for error envelope payloads
11-
docker build -t sentry-self-hosted-jq-local --platform=$DOCKER_PLATFORM $basedir/jq
1210
echo ""
1311
echo "Docker images built."
1412

install/dc-detect-version.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ if [[ "$(basename $0)" = "install.sh" ]]; then
1515
else
1616
dc="$dc_base --ansi never"
1717
fi
18+
proxy_args="--build-arg http_proxy=${http_proxy:-} --build-arg https_proxy=${https_proxy:-} --build-arg no_proxy=${no_proxy:-}"
1819
dcr="$dc run --rm"
20+
dcb="$dc build $proxy_args"
21+
dbuild="docker build $proxy_args"
1922

2023
echo "${_endgroup}"

install/error-handling.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export SENTRY_DSN='https://[email protected]
44
export SENTRY_ORG=self-hosted
55
export SENTRY_PROJECT=installer
66

7+
$dbuild -t sentry-self-hosted-jq-local --platform=$DOCKER_PLATFORM $basedir/jq
8+
79
jq="docker run --rm -i sentry-self-hosted-jq-local"
810
sentry_cli="docker run --rm -v /tmp:/work -e SENTRY_ORG=$SENTRY_ORG -e SENTRY_PROJECT=$SENTRY_PROJECT -e SENTRY_DSN=$SENTRY_DSN getsentry/sentry-cli"
911
log_path="$basedir/$log_file"

0 commit comments

Comments
 (0)