Skip to content

Commit f770395

Browse files
authored
Merge pull request #33 from silinternational/revert-32-feature-data-image
Revert "Adding Sentry SDK"
2 parents 85b3679 + d1ece8f commit f770395

File tree

2 files changed

+13
-22
lines changed

2 files changed

+13
-22
lines changed

Dockerfile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
1-
# Build stage
2-
FROM python:3-alpine as builder
3-
4-
RUN apk add --no-cache curl \
5-
&& curl -sL https://sentry.io/get-cli/ | bash
6-
7-
# Final stage
81
FROM python:3-alpine
92

103
# Current version of s3cmd is in edge/testing repo
114
RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
125

136
# Install everything via repo, because repo & pip installs can break things
147
RUN apk update \
15-
&& apk add --no-cache \
8+
&& apk add --no-cache \
169
bash \
1710
mysql-client \
1811
py3-magic \
1912
py3-dateutil \
2013
py3-six \
2114
s3cmd
2215

23-
# Copy Sentry CLI binary from builder
24-
COPY --from=builder /usr/local/bin/sentry-cli /usr/local/bin/sentry-cli
25-
2616
COPY application/ /data/
2717
WORKDIR /data
2818

application/backup.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ error_to_sentry() {
77
local status_code="$3"
88

99
if [ ! -z "${SENTRY_DSN}" ]; then
10-
# Export the DSN for Sentry CLI
11-
export SENTRY_DSN="${SENTRY_DSN}"
12-
13-
# Send event using Sentry CLI
14-
sentry-cli send-event \
15-
--message "${error_message}" \
16-
--level error \
17-
--extra database="${db_name}" \
18-
--extra status_code="${status_code}" \
19-
--extra hostname="${HOSTNAME}"
20-
fi
10+
wget -q --header="Content-Type: application/json" \
11+
--post-data="{
12+
\"message\": \"${error_message}\",
13+
\"level\": \"error\",
14+
\"extra\": {
15+
\"database\": \"${db_name}\",
16+
\"status_code\": \"${status_code}\",
17+
\"hostname\": \"${HOSTNAME}\"
18+
}
19+
}" \
20+
-O - "${SENTRY_DSN}"
21+
fi
2122
}
2223

2324
STATUS=0

0 commit comments

Comments
 (0)