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

Docs and output tinkering for commit check #1191

Merged
merged 2 commits into from
Dec 7, 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: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Please keep in mind to check the `.env` file for changes, when you perform an up

To get started with all the defaults, simply clone the repo and run `./install.sh` in your local check-out. Sentry uses Python 3 by default since December 4th, 2020 and Sentry 21.1.0 is the last version to support Python 2.

During the install, a prompt will ask if you want to create a user account. If you require that the install not be blocked by the prompt, run `./install.sh --no-user-prompt`.
During the install, a prompt will ask if you want to create a user account. If you require that the install not be blocked by the prompt, run `./install.sh --skip-user-prompt`.

Please visit [our documentation](https://develop.sentry.dev/self-hosted/) for everything else.

Expand Down
8 changes: 6 additions & 2 deletions install/check-latest-commit.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/bin/bash
echo "${_group}Checking for latest commit ... "

# Checks if we are on latest commit from github if it is running from master branch
if [[ -d "../.git" && "${SKIP_COMMIT_CHECK:-0}" != 1 ]]; then
if [[ $(git branch | sed -n '/\* /s///p') == "master" ]]; then
if [[ $(git rev-parse HEAD) != $(git ls-remote $(git rev-parse --abbrev-ref @{u} | sed 's/\// /g') | cut -f1) ]]; then
echo "Seems like you are not using the latest commit from self-hosted repository. Please pull the latest changes and try again.";
echo "Seems like you are not using the latest commit from the self-hosted repository. Please pull the latest changes and try again, or suppress this check with --skip-commit-check.";
exit 1
fi
fi
else
echo "skipped"
fi

echo "${_endgroup}"
19 changes: 13 additions & 6 deletions install/parse-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ show_help() {
cat <<EOF
Usage: $0 [options]

Install Sentry with `docker compose`.
Install Sentry with \`docker compose\`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Backticks spawn a subshell here, need to escape them. Regression in #1179.


Options:
-h, --help Show this message and exit.
--no-user-prompt Skips the initial user creation prompt (ideal for non-interactive installs).
--minimize-downtime EXPERIMENTAL: try to keep accepting events for as long as possible while upgrading.
This will disable cleanup on error, and might leave your installation in partially upgraded state.
This option might not reload all configuration, and is only meant for in-place upgrades.
--minimize-downtime EXPERIMENTAL: try to keep accepting events for as long
as possible while upgrading. This will disable cleanup
on error, and might leave your installation in a
partially upgraded state. This option might not reload
all configuration, and is only meant for in-place
upgrades.
--skip-commit-check Skip the check for the latest commit when on the master
branch of a \`self-hosted\` Git working copy.
--skip-user-prompt Skip the initial user creation prompt (ideal for non-
interactive installs).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opportunistic reformat for 80-char lines, sort alphabetically.

EOF
}

Expand All @@ -22,7 +28,8 @@ SKIP_COMMIT_CHECK="${SKIP_COMMIT_CHECK:-}"
while (( $# )); do
case "$1" in
-h | --help) show_help; exit;;
--no-user-prompt) SKIP_USER_PROMPT=1;;
--no-user-prompt) SKIP_USER_PROMPT=1;; # deprecated
--skip-user-prompt) SKIP_USER_PROMPT=1;;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have --no-* for one and --skip-* for the other. Let's standardize on --skip.

--minimize-downtime) MINIMIZE_DOWNTIME=1;;
--skip-commit-check) SKIP_COMMIT_CHECK=1;;
--) ;;
Expand Down