move Sentry API call from .travis.yml to release.sh (#1837)

This commit is contained in:
Charly C 2020-08-03 12:03:37 +02:00 committed by GitHub
parent de44d36fb7
commit 3555556855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 16 deletions

1
.gitignore vendored
View File

@ -15,6 +15,7 @@ tests/py/fixtures/TestTranslations.yml
.idea/
payday-*.txt*
payday.pid
.sentry-token
# Elastic Beanstalk Files
.elasticbeanstalk/*

View File

@ -19,22 +19,6 @@ install:
- if [ "${TRAVIS_BRANCH}" = "master" -a "${TRAVIS_PULL_REQUEST}" = "false" ]; then rm -rf .tox; fi
- pip install tox "six>=1.14.0"
before_script:
- |
version=$(python liberapay/version.py)
if [ "${TRAVIS_BRANCH}" = "master" -a "${TRAVIS_PULL_REQUEST}" = "false" ] && [[ "$version" =~ ^[0-9]+$ ]]; then
curl https://sentry.io/api/0/organizations/liberapay/releases/ \
-X POST \
-H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"version": "'$version'",
"refs": [{
"repository": "liberapay/liberapay.com",
"commit": "'$TRAVIS_COMMIT'"
}],
"projects": ["liberapaycom"]
}'
fi
- psql -U postgres -c 'CREATE DATABASE liberapay_tests;'
- DATABASE_URL=liberapay_tests ./recreate-schema.sh test
- if [ "${TRAVIS_BRANCH}" = "master" -a "${TRAVIS_PULL_REQUEST}" = "false" ]; then rm -rfv tests/py/fixtures; export LIBERAPAY_I18N_TEST=yes; fi

View File

@ -39,6 +39,13 @@ require () {
require eb
require git
# Check that we have the required credentials
sentry_token="$(cat .sentry-token 2>/dev/null || true)"
if [ -z "$sentry_token" ]; then
echo "The Sentry API token is missing, please put it in the '.sentry-token' file (in the same directory as this script)."
exit 1
fi
# Make sure we have the latest master
git checkout -q master
git pull
@ -161,3 +168,17 @@ fi
# Push to GitHub
git push
git push --tags
# Tell Sentry about this release
curl https://sentry.io/api/0/organizations/liberapay/releases/ \
-X POST \
-H "Authorization: Bearer $sentry_token" \
-H "Content-Type: application/json" \
-d '{
"version": "'$version'",
"refs": [{
"repository": "liberapay/liberapay.com",
"commit": "'$(git rev-list -n 1 $version)'"
}],
"projects": ["liberapaycom"]
}'