Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9346064
reset.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
reset.sh
View Options
#!/usr/bin/env bash
# The purpose of this script is to make it easy to reset a local onpremise
# install to a clean state, optionally targeting a particular version.
set
-euo
pipefail
if
[
-n
"
${
DEBUG
:-
}
"
]
;
then
set
-x
fi
cd
"
$(
dirname
$0
)
"
function
confirm
()
{
read
-p
"
$1
[y/n] "
confirmation
if
[
"
$confirmation
"
!
=
"y"
]
;
then
echo
"Canceled. 😅"
exit
fi
}
# If we have a version given, validate it.
# ----------------------------------------
# Note that arbitrary git refs won't work, because the *_IMAGE variables in
# .env will almost certainly point to :latest. Tagged releases are generally
# the only refs where these component versions are pinned, so enforce that
# we're targeting a valid tag here. Do this early in order to fail fast.
version
=
"
${
1
:-
}
"
if
[
-n
"
$version
"
]
;
then
set
+e
git
rev-parse
--verify
--quiet
"refs/tags/
$version
"
>
/dev/null
if
[
$?
-gt
0
]
;
then
echo
"Bad version:
$version
"
exit
fi
set
-e
fi
# Make sure they mean it.
confirm
"☠️ Warning! 😳 This is highly destructive! 😱 Are you sure you wish to proceed?"
echo
"Okay ... good luck! 😰"
# Hit the reset button.
docker-compose
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
docker
volume
remove
$volume
>
/dev/null
\
&&
echo
"Removed volume:
$volume
"
\
||
echo
"Skipped volume:
$volume
"
done
# If we have a version given, switch to it.
if
[
-n
"
$version
"
]
;
then
git
checkout
"
$version
"
fi
# Install.
exec
./install.sh
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Fri, Jul 4, 3:42 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3249831
Attached To
R206 getsentry-onpremise
Event Timeline
Log In to Comment