-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ci: Skip DB ops during install completely on cache hit #3496
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a89fd0d
ci: Skip DB ops during install completely on cache hit
BYK 5dae37a
some fixes
BYK aaf481f
tar perms
BYK 50cd56e
some debugging
BYK 148ac6f
fix upgrade test
BYK 1067f9a
fix env var setting
BYK 0ad043a
fix skip logic
BYK 3403cb7
Merge branch 'master' into byk/ci/skip-db-completely-on-cache
BYK 2df9e25
try reverting `user: root` in kafka
BYK c7433fb
use correct uid and guid
BYK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
echo "${_group}Setting up / migrating database ..." | ||
|
||
# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue | ||
$dc up --wait postgres | ||
if [[ -z "${SKIP_DB_MIGRATIONS:-}" ]]; then | ||
# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue | ||
$dc up --wait postgres | ||
|
||
os=$($dc exec postgres cat /etc/os-release | grep 'ID=debian') | ||
if [[ -z $os ]]; then | ||
echo "Postgres image debian check failed, exiting..." | ||
exit 1 | ||
fi | ||
os=$($dc exec postgres cat /etc/os-release | grep 'ID=debian') | ||
if [[ -z $os ]]; then | ||
echo "Postgres image debian check failed, exiting..." | ||
exit 1 | ||
fi | ||
|
||
# Using django ORM to provide broader support for users with external databases | ||
$dcr web shell -c " | ||
# Using django ORM to provide broader support for users with external databases | ||
$dcr web shell -c " | ||
from django.db import connection | ||
|
||
with connection.cursor() as cursor: | ||
cursor.execute('ALTER TABLE IF EXISTS sentry_groupedmessage DROP CONSTRAINT IF EXISTS sentry_groupedmessage_project_id_id_515aaa7e_uniq;') | ||
cursor.execute('DROP INDEX IF EXISTS sentry_groupedmessage_project_id_id_515aaa7e_uniq;') | ||
" | ||
|
||
if [[ -n "${CI:-}" || "${SKIP_USER_CREATION:-0}" == 1 ]]; then | ||
$dcr web upgrade --noinput --create-kafka-topics | ||
echo "" | ||
echo "Did not prompt for user creation. Run the following command to create one" | ||
echo "yourself (recommended):" | ||
echo "" | ||
echo " $dc_base run --rm web createuser" | ||
echo "" | ||
if [[ -n "${CI:-}" || "${SKIP_USER_CREATION:-0}" == 1 ]]; then | ||
$dcr web upgrade --noinput --create-kafka-topics | ||
echo "" | ||
echo "Did not prompt for user creation. Run the following command to create one" | ||
echo "yourself (recommended):" | ||
echo "" | ||
echo " $dc_base run --rm web createuser" | ||
echo "" | ||
else | ||
$dcr web upgrade --create-kafka-topics | ||
fi | ||
else | ||
$dcr web upgrade --create-kafka-topics | ||
echo "Skipped DB migrations due to SKIP_DB_MIGRATIONS=$SKIP_DB_MIGRATIONS" | ||
fi | ||
|
||
echo "${_endgroup}" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.