diff --git a/Dockerfile b/Dockerfile index df45a45..49ea8db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,3 @@ -# 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 @@ -12,7 +5,7 @@ RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/reposito # 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 \ @@ -20,9 +13,6 @@ RUN apk update \ 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 diff --git a/application/backup.sh b/application/backup.sh index 52b312c..258ff90 100755 --- a/application/backup.sh +++ b/application/backup.sh @@ -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