mirror of
https://github.com/getsentry/self-hosted.git
synced 2025-12-08 19:46:14 +00:00
Check for latest commit before install.sh (#1186)
This commit is contained in:
parent
c258a1e939
commit
3c060fc8d8
@ -8,6 +8,7 @@ fi
|
|||||||
source "$(dirname $0)/install/_lib.sh" # does a `cd .../install/`, among other things
|
source "$(dirname $0)/install/_lib.sh" # does a `cd .../install/`, among other things
|
||||||
|
|
||||||
source parse-cli.sh
|
source parse-cli.sh
|
||||||
|
source check-latest-commit.sh
|
||||||
source error-handling.sh
|
source error-handling.sh
|
||||||
source check-minimum-requirements.sh
|
source check-minimum-requirements.sh
|
||||||
source create-docker-volumes.sh
|
source create-docker-volumes.sh
|
||||||
|
|||||||
11
install/check-latest-commit.sh
Normal file
11
install/check-latest-commit.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 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.";
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@ -17,12 +17,14 @@ EOF
|
|||||||
|
|
||||||
SKIP_USER_PROMPT="${SKIP_USER_PROMPT:-}"
|
SKIP_USER_PROMPT="${SKIP_USER_PROMPT:-}"
|
||||||
MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}"
|
MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}"
|
||||||
|
SKIP_COMMIT_CHECK="${SKIP_COMMIT_CHECK:-}"
|
||||||
|
|
||||||
while (( $# )); do
|
while (( $# )); do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | --help) show_help; exit;;
|
-h | --help) show_help; exit;;
|
||||||
--no-user-prompt) SKIP_USER_PROMPT=1;;
|
--no-user-prompt) SKIP_USER_PROMPT=1;;
|
||||||
--minimize-downtime) MINIMIZE_DOWNTIME=1;;
|
--minimize-downtime) MINIMIZE_DOWNTIME=1;;
|
||||||
|
--skip-commit-check) SKIP_COMMIT_CHECK=1;;
|
||||||
--) ;;
|
--) ;;
|
||||||
*) echo "Unexpected argument: $1. Use --help for usage information."; exit 1;;
|
*) echo "Unexpected argument: $1. Use --help for usage information."; exit 1;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user