File tree Expand file tree Collapse file tree 2 files changed +13
-22
lines changed Expand file tree Collapse file tree 2 files changed +13
-22
lines changed Original file line number Diff line number Diff line change 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
81FROM python:3-alpine
92
103# Current version of s3cmd is in edge/testing repo
114RUN 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
147RUN 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-
2616COPY application/ /data/
2717WORKDIR /data
2818
Original file line number Diff line number Diff line change @@ -7,17 +7,18 @@ error_to_sentry() {
77 local status_code=" $3 "
88
99if [ ! -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
2324STATUS=0
You can’t perform that action at this time.
0 commit comments