This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from ds-wizard/release/3.13.0
Release 3.13.0
- Loading branch information
Showing
11 changed files
with
150 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,6 +1,7 @@ | ||
from .command_queue import CommandWorker, CommandQueue | ||
from .database import Database, PostgresConnection, PersistentCommand | ||
from .sentry import SentryReporter | ||
from .smtp import SMTPSender | ||
|
||
__all__ = ['CommandQueue', 'CommandWorker', 'Database', 'PersistentCommand', | ||
'PostgresConnection', 'SMTPSender'] | ||
'PostgresConnection', 'SentryReporter', 'SMTPSender'] |
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import sentry_sdk | ||
|
||
from ..consts import BUILD_INFO | ||
|
||
|
||
class SentryReporter: | ||
|
||
@classmethod | ||
def initialize(cls, dsn: str, server_name: str, environment: str): | ||
sentry_sdk.init( | ||
dsn=dsn, | ||
traces_sample_rate=1.0, | ||
release=BUILD_INFO['version'], | ||
server_name=server_name, | ||
environment=environment, | ||
) | ||
sentry_sdk.set_tag('worker', BUILD_INFO['name']) | ||
|
||
@staticmethod | ||
def capture_exception(*args, **kwargs): | ||
sentry_sdk.capture_exception(*args, **kwargs) | ||
|
||
@staticmethod | ||
def capture_message(*args, **kwargs): | ||
sentry_sdk.capture_message(*args, **kwargs) |
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# File with build info | ||
BUILD_INFO_FILE=dsw_mailer/consts.py | ||
|
||
# Create version based on git tag or branch | ||
branch=$(git rev-parse --abbrev-ref HEAD) | ||
commit=$(git rev-parse --short HEAD) | ||
version="$branch~$commit" | ||
gittag=$(git tag -l --contains HEAD | head -n 1) | ||
if test -n "$gittag" | ||
then | ||
version="$gittag~$commit" | ||
fi | ||
|
||
# Get build timestamp | ||
builtAt=$(date +"%Y-%m-%d %TZ") | ||
|
||
cat $BUILD_INFO_FILE | ||
# Replace values | ||
sed -i.bak "s#--BUILT_AT--#$version#" $BUILD_INFO_FILE && rm $BUILD_INFO_FILE".bak" | ||
sed -i.bak "s#--VERSION--#$builtAt#" $BUILD_INFO_FILE && rm $BUILD_INFO_FILE".bak" | ||
|
||
cat $BUILD_INFO_FILE |
This file contains 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