Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reset.sh docker-compose call #1215

Merged
merged 3 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _integration-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set -ex

source "$(dirname $0)/../install/_lib.sh"

source ../install/dc-detect-version.sh

echo "${_group}Setting up variables and helpers ..."
export SENTRY_TEST_HOST="${SENTRY_TEST_HOST:-http://localhost:9000}"
TEST_USER='[email protected]'
Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fi

source "$(dirname $0)/install/_lib.sh" # does a `cd .../install/`, among other things

source dc-detect-version.sh
source parse-cli.sh
source check-latest-commit.sh
source error-handling.sh
Expand Down
5 changes: 0 additions & 5 deletions install/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ else
_endgroup=""
fi

# Some environments still use `docker-compose` even for Docker Compose v2.
dc_base="$(docker compose version &> /dev/null && echo 'docker compose' || echo 'docker-compose')"
dc="$dc_base --ansi never --env-file ${_ENV}"
dcr="$dc run --rm"

# A couple of the config files are referenced from other subscripts, so they
# get vars, while multiple subscripts call ensure_file_from_example.
function ensure_file_from_example {
Expand Down
8 changes: 8 additions & 0 deletions install/dc-detect-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Some environments still use `docker-compose` even for Docker Compose v2.
dc_base="$(docker compose version &> /dev/null && echo 'docker compose' || echo 'docker-compose')"
if [[ "$(basename $0)" = "install.sh" ]]; then
dc="$dc_base --ansi never --env-file ${_ENV}"
else
dc="$dc_base --ansi never"
fi
dcr="$dc run --rm"
3 changes: 2 additions & 1 deletion reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fi

cd "$(dirname $0)"

source install/dc-detect-version.sh

function confirm () {
read -p "$1 [y/n] " confirmation
Expand Down Expand Up @@ -44,7 +45,7 @@ confirm "☠️ Warning! 😳 This is highly destructive! 😱 Are you sure you
echo "Okay ... good luck! 😰"

# Hit the reset button.
docker compose down --volumes --remove-orphans --rmi local
$dc down --volumes --remove-orphans --rmi local

# Remove any remaining (likely external) volumes with name matching 'sentry-.*'.
for volume in $(docker volume list --format '{{ .Name }}' | grep '^sentry-'); do
Expand Down