Skip to content

Commit

Permalink
Merge pull request #33 from silinternational/revert-32-feature-data-i…
Browse files Browse the repository at this point in the history
…mage

Revert "Adding Sentry SDK"
  • Loading branch information
Praveenraj-K authored Jan 9, 2025
2 parents 85b3679 + d1ece8f commit f770395
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
12 changes: 1 addition & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
# Build stage
FROM python:3-alpine as builder

RUN apk add --no-cache curl \
&& curl -sL https://sentry.io/get-cli/ | bash

# Final stage
FROM python:3-alpine

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

# Install everything via repo, because repo & pip installs can break things
RUN apk update \
&& apk add --no-cache \
&& apk add --no-cache \
bash \
mysql-client \
py3-magic \
py3-dateutil \
py3-six \
s3cmd

# Copy Sentry CLI binary from builder
COPY --from=builder /usr/local/bin/sentry-cli /usr/local/bin/sentry-cli

COPY application/ /data/
WORKDIR /data

Expand Down
23 changes: 12 additions & 11 deletions application/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ error_to_sentry() {
local status_code="$3"

if [ ! -z "${SENTRY_DSN}" ]; then
# Export the DSN for Sentry CLI
export SENTRY_DSN="${SENTRY_DSN}"

# Send event using Sentry CLI
sentry-cli send-event \
--message "${error_message}" \
--level error \
--extra database="${db_name}" \
--extra status_code="${status_code}" \
--extra hostname="${HOSTNAME}"
fi
wget -q --header="Content-Type: application/json" \
--post-data="{
\"message\": \"${error_message}\",
\"level\": \"error\",
\"extra\": {
\"database\": \"${db_name}\",
\"status_code\": \"${status_code}\",
\"hostname\": \"${HOSTNAME}\"
}
}" \
-O - "${SENTRY_DSN}"
fi
}

STATUS=0
Expand Down

0 comments on commit f770395

Please sign in to comment.