mirror of
https://github.com/getsentry/self-hosted.git
synced 2025-12-08 19:46:14 +00:00
Add dcx shortcut for docker compose exec with HTTP proxy env vars (#4067)
* Initial plan * Add dcep shortcut for docker compose exec with http proxy Co-authored-by: BYK <126780+BYK@users.noreply.github.com> * Quote environment variable values in dcep shortcut Co-authored-by: BYK <126780+BYK@users.noreply.github.com> * Rename dcep to dcx (docker compose exec shortcut) Co-authored-by: BYK <126780+BYK@users.noreply.github.com> * Move dcx after if/else block and use exec_proxy_args for DRY Co-authored-by: BYK <126780+BYK@users.noreply.github.com> * Remove exec_proxy_args and inline proxy flags in dcx Co-authored-by: BYK <126780+BYK@users.noreply.github.com> * Add exec_proxy_args variable and use it in dcx definition Co-authored-by: BYK <126780+BYK@users.noreply.github.com> * Use $dcx shortcut in bootstrap-s3-profiles.sh Co-authored-by: aldy505 <7274326+aldy505@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: BYK <126780+BYK@users.noreply.github.com> Co-authored-by: Reinaldy Rafli <github@reinaldyrafli.com> Co-authored-by: aldy505 <7274326+aldy505@users.noreply.github.com>
This commit is contained in:
parent
a73563f172
commit
c9aa6268f5
@ -1,7 +1,7 @@
|
||||
echo "${_group}Bootstrapping seaweedfs (node store)..."
|
||||
|
||||
start_service_and_wait_ready seaweedfs postgres
|
||||
$dc exec -e "HTTP_PROXY=${HTTP_PROXY:-}" -e "HTTPS_PROXY=${HTTPS_PROXY:-}" -e "NO_PROXY=${NO_PROXY:-}" -e "http_proxy=${http_proxy:-}" -e "https_proxy=${https_proxy:-}" -e "no_proxy=${no_proxy:-}" seaweedfs apk add --no-cache s3cmd
|
||||
$dcx seaweedfs apk add --no-cache s3cmd
|
||||
$dc exec seaweedfs mkdir -p /data/idx/
|
||||
s3cmd="$dc exec seaweedfs s3cmd"
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then
|
||||
echo "${_group}Bootstrapping seaweedfs (profiles)..."
|
||||
|
||||
start_service_and_wait_ready seaweedfs
|
||||
$dc exec -e "HTTP_PROXY=${HTTP_PROXY:-}" -e "HTTPS_PROXY=${HTTPS_PROXY:-}" -e "NO_PROXY=${NO_PROXY:-}" -e "http_proxy=${http_proxy:-}" -e "https_proxy=${https_proxy:-}" -e "no_proxy=${no_proxy:-}" seaweedfs apk add --no-cache s3cmd
|
||||
$dcx seaweedfs apk add --no-cache s3cmd
|
||||
s3cmd="$dc exec seaweedfs s3cmd"
|
||||
|
||||
bucket_list=$($s3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=localhost:8333 --host-bucket='localhost:8333/%(bucket)' ls)
|
||||
@ -80,7 +80,7 @@ if [[ "$COMPOSE_PROFILES" == "feature-complete" ]]; then
|
||||
|
||||
# Use a temporary container to copy files from the volume to SeaweedFS
|
||||
|
||||
$dc exec -e "HTTP_PROXY=${HTTP_PROXY:-}" -e "HTTPS_PROXY=${HTTPS_PROXY:-}" -e "NO_PROXY=${NO_PROXY:-}" -e "http_proxy=${http_proxy:-}" -e "https_proxy=${https_proxy:-}" -e "no_proxy=${no_proxy:-}" -u root vroom sh -c 'mkdir -p /var/lib/apt/lists/partial && apt-get update && apt-get install -y --no-install-recommends s3cmd'
|
||||
$dcx -u root vroom sh -c 'mkdir -p /var/lib/apt/lists/partial && apt-get update && apt-get install -y --no-install-recommends s3cmd'
|
||||
$dc exec vroom sh -c 's3cmd --access_key=sentry --secret_key=sentry --no-ssl --region=us-east-1 --host=seaweedfs:8333 --host-bucket="seaweedfs:8333/%(bucket)" sync /var/vroom/sentry-profiles/ s3://profiles/'
|
||||
|
||||
echo "Migration completed."
|
||||
|
||||
@ -48,6 +48,7 @@ else
|
||||
fi
|
||||
|
||||
proxy_args="--build-arg HTTP_PROXY=${HTTP_PROXY:-} --build-arg HTTPS_PROXY=${HTTPS_PROXY:-} --build-arg NO_PROXY=${NO_PROXY:-} --build-arg http_proxy=${http_proxy:-} --build-arg https_proxy=${https_proxy:-} --build-arg no_proxy=${no_proxy:-}"
|
||||
exec_proxy_args="-e HTTP_PROXY=${HTTP_PROXY:-} -e HTTPS_PROXY=${HTTPS_PROXY:-} -e NO_PROXY=${NO_PROXY:-} -e http_proxy=${http_proxy:-} -e https_proxy=${https_proxy:-} -e no_proxy=${no_proxy:-}"
|
||||
if [[ "$CONTAINER_ENGINE" == "podman" ]]; then
|
||||
proxy_args_dc="--podman-build-args HTTP_PROXY=${HTTP_PROXY:-},HTTPS_PROXY=${HTTPS_PROXY:-},NO_PROXY=${NO_PROXY:-},http_proxy=${http_proxy:-},https_proxy=${https_proxy:-},no_proxy=${no_proxy:-}"
|
||||
# Disable pod creation as these are one-off commands and creating a pod
|
||||
@ -60,6 +61,7 @@ else
|
||||
fi
|
||||
dcb="$dc build $proxy_args"
|
||||
dbuild="$CONTAINER_ENGINE build $proxy_args"
|
||||
dcx="$dc exec $exec_proxy_args"
|
||||
echo "$dcr"
|
||||
# Utility function to handle --wait with docker and podman
|
||||
function start_service_and_wait_ready() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user