Skip to content

Commit

Permalink
add sentry release
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Sep 19, 2023
1 parent f11203a commit 41098e2
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
DOCKER_TAG: ${{ github.sha }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
VERIFY_SSL: "false"
SENTRY_RELEASE: ${{ github.sha }}

jobs:
build_keycloak:
Expand Down
9 changes: 6 additions & 3 deletions databox/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ RUN apk add --no-cache \
imagick \
&& apk del build-essentials

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates

# Warm up composer cache for faster builds
COPY docker/caching/composer.* ./
RUN composer install --prefer-dist --no-dev --no-progress --classmap-authoritative --no-interaction --no-scripts \
Expand All @@ -41,9 +45,8 @@ RUN mkdir -p var/cache var/logs var/sessions \
&& composer clear-cache \
&& chown -R app: .

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates
ARG SENTRY_RELEASE
ENV SENTRY_RELEASE=${SENTRY_RELEASE}

ENTRYPOINT ["/srv/app/docker/php-entrypoint.sh"]

Expand Down
1 change: 0 additions & 1 deletion databox/api/config/packages/alchemy_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ alchemy_core:
app_name: databox
app_url: '%env(DATABOX_API_URL)%'
healthcheck: ~
sentry: ~
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ services:
args:
BASE_TAG: ${DOCKER_TAG}
REGISTRY_NAMESPACE: ${REGISTRY_NAMESPACE}
SENTRY_RELEASE: ${SENTRY_RELEASE}
networks:
- internal
depends_on:
Expand Down
9 changes: 6 additions & 3 deletions expose/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ ARG BASE_TAG=latest
ARG REGISTRY_NAMESPACE
FROM ${REGISTRY_NAMESPACE}php-fpm-base:${BASE_TAG} AS api-php

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates

# Warm up composer cache for faster builds
COPY docker/caching/composer.* ./
RUN composer install --prefer-dist --no-dev --no-progress --classmap-authoritative --no-interaction --no-scripts \
Expand All @@ -15,9 +19,8 @@ RUN mkdir -p var/cache var/logs var/sessions \
&& composer clear-cache \
&& chown -R app: .

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates
ARG SENTRY_RELEASE
ENV SENTRY_RELEASE=${SENTRY_RELEASE}

ENTRYPOINT ["/srv/app/docker/php-entrypoint.sh"]

Expand Down
1 change: 0 additions & 1 deletion expose/api/config/packages/alchemy_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ alchemy_core:
app_name: expose
app_url: '%env(EXPOSE_API_URL)%'
healthcheck: ~
sentry: ~
16 changes: 7 additions & 9 deletions lib/php/core-bundle/DependencyInjection/AlchemyCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public function load(array $configs, ContainerBuilder $container): void
$this->loadHealthCheckers($container);
}

if ($config['sentry']['enabled']) {
$bundles = $container->getParameter('kernel.bundles');
if (isset($bundles['SentryBundle'])) {
$loader->load('sentry.yaml');
$this->loadSentry($container);
}
Expand All @@ -72,14 +73,11 @@ private function loadHealthCheckers(ContainerBuilder $container): void

private function loadSentry(ContainerBuilder $container): void
{
$bundles = $container->getParameter('kernel.bundles');
if (isset($bundles['SentryBundle'])) {
$def = new Definition(PsrLogMessageProcessor::class);
$def->addTag('monolog.processor', [
'handler' =>'sentry',
]);
$container->setDefinition(PsrLogMessageProcessor::class, $def);
}
$def = new Definition(PsrLogMessageProcessor::class);
$def->addTag('monolog.processor', [
'handler' =>'sentry',
]);
$container->setDefinition(PsrLogMessageProcessor::class, $def);
}

private function loadFixtures(ContainerBuilder $container, LoaderInterface $loader): void
Expand Down
5 changes: 0 additions & 5 deletions lib/php/core-bundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public function getConfigTreeBuilder(): TreeBuilder
->children()
->end()
->end()
->arrayNode('sentry')
->canBeEnabled()
->children()
->end()
->end()
->end()
;

Expand Down
1 change: 0 additions & 1 deletion lib/php/core-bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Enable the feature:
# config/packages/alchemy_core.yml
alchemy_core:
healthcheck: ~
sentry: ~
```
Add route:
Expand Down
6 changes: 0 additions & 6 deletions lib/php/core-bundle/Resources/config/monolog/prod.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
monolog:
handlers:
sentry:
type: fingers_crossed
action_level: error
handler: sentry_nested
excluded_http_codes: [ 405, 401, 403, 404, 400 ]
buffer_size: 5
# main:
# type: fingers_crossed
# action_level: error
Expand Down
9 changes: 6 additions & 3 deletions notify/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ ARG BASE_TAG=latest
ARG REGISTRY_NAMESPACE
FROM ${REGISTRY_NAMESPACE}php-fpm-base:${BASE_TAG} AS api-php

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates

# Warm up composer cache for faster builds
COPY docker/caching/composer.* ./
RUN composer install --prefer-dist --no-dev --no-progress --classmap-authoritative --no-interaction --no-scripts \
Expand All @@ -15,9 +19,8 @@ RUN mkdir -p var/cache var/logs var/sessions \
&& composer clear-cache \
&& chown -R app: .

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates
ARG SENTRY_RELEASE
ENV SENTRY_RELEASE=${SENTRY_RELEASE}

ENTRYPOINT ["/srv/app/docker/php-entrypoint.sh"]

Expand Down
1 change: 0 additions & 1 deletion notify/api/config/packages/alchemy_core.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
alchemy_core:
app_name: notify
healthcheck: ~
sentry: ~
9 changes: 6 additions & 3 deletions uploader/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ FROM ${REGISTRY_NAMESPACE}php-fpm-base:${BASE_TAG} AS api-php

RUN printf "\nrequest_terminate_timeout = 600\n" >> /usr/local/etc/php-fpm.d/large-upload.conf

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates

# Warm up composer cache for faster builds
COPY docker/caching/composer.* ./
RUN composer install --prefer-dist --no-dev --no-progress --classmap-authoritative --no-interaction --no-scripts \
Expand All @@ -17,9 +21,8 @@ RUN mkdir -p var/cache var/logs var/sessions \
&& composer clear-cache \
&& chown -R app: .

ADD https://letsencrypt.org/certs/staging/letsencrypt-stg-root-x1.pem /usr/local/share/ca-certificates/letsencrypt-root-ca.pem
RUN chmod 644 /usr/local/share/ca-certificates/letsencrypt-root-ca.pem \
&& update-ca-certificates
ARG SENTRY_RELEASE
ENV SENTRY_RELEASE=${SENTRY_RELEASE}

ENTRYPOINT ["/srv/app/docker/php-entrypoint.sh"]

Expand Down
1 change: 0 additions & 1 deletion uploader/api/config/packages/alchemy_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ alchemy_core:
app_name: uploader
app_url: '%env(UPLOADER_API_URL)%'
healthcheck: ~
sentry: ~

0 comments on commit 41098e2

Please sign in to comment.