Staging instance, all changes can be removed at any time

Skip to content

swh-web: Fix cronjob sync-mailmaps

Antoine R. Dumont requested to merge fix-syncmailmap-cronjob into production

Currently it was hard-coded to only be named sync-mailmaps but triggered the refresh-save-codenow-statuses.

The swh-web image is bumped to be able to deal with the sync-mailmaps script execution.

make swh-helm-diff
[swh] Comparing changes between branches production and fix-syncmailmap-cronjob (per environment)...
Switched to branch 'production'
Your branch is up to date with 'origin/production'.
[swh] Generate config in production branch for environment staging, namespace swh...
[swh] Generate config in production branch for environment staging, namespace swh-cassandra...
[swh] Generate config in production branch for environment staging, namespace swh-cassandra-next-version...
Switched to branch 'fix-syncmailmap-cronjob'
[swh] Generate config in fix-syncmailmap-cronjob branch for environment staging...
[swh] Generate config in fix-syncmailmap-cronjob branch for environment staging...
[swh] Generate config in fix-syncmailmap-cronjob branch for environment staging...
Switched to branch 'production'
Your branch is up to date with 'origin/production'.
[swh] Generate config in production branch for environment production, namespace swh...
[swh] Generate config in production branch for environment production, namespace swh-cassandra...
[swh] Generate config in production branch for environment production, namespace swh-cassandra-next-version...
Switched to branch 'fix-syncmailmap-cronjob'
[swh] Generate config in fix-syncmailmap-cronjob branch for environment production...
[swh] Generate config in fix-syncmailmap-cronjob branch for environment production...
[swh] Generate config in fix-syncmailmap-cronjob branch for environment production...


------------- diff for environment staging namespace swh -------------

--- /tmp/swh-chart.swh.ngFp2D7O/staging-swh.before      2023-10-24 17:26:08.840205189 +0200
+++ /tmp/swh-chart.swh.ngFp2D7O/staging-swh.after       2023-10-24 17:26:09.736204437 +0200
@@ -21900,32 +21900,29 @@
                       # 'name' secret should exist & include key
                       # if the setting doesn't exist, sentry pushes will be disabled
                       optional: true

               volumeMounts:
               - name: configuration
                 mountPath: /etc/swh
               - name: configuration-template
                 mountPath: /etc/swh/configuration-template
           containers:
-            - name: sync-mailmaps
+            - name: refresh-savecodenow-statuses
               resources:
                 requests:
                   memory: 512Mi
                   cpu: 500m
               image: container-registry.softwareheritage.org/swh/infra/swh-apps/web:20231024.1
               command:
               - /opt/swh/entrypoint.sh
               args:
-              # - shell
-              # - sleep
-              # - infinity
               - refresh
               env:
                 - name: STATSD_HOST
                   value: prometheus-statsd-exporter
                 - name: STATSD_PORT
                   value: "9125"
                 - name: SWH_CONFIG_FILENAME
                   value: /etc/swh/config.yml
                 - name: LOG_LEVEL
                   value: INFO
@@ -22047,33 +22044,41 @@
           containers:
             - name: sync-mailmaps
               resources:
                 requests:
                   memory: 512Mi
                   cpu: 500m
               image: container-registry.softwareheritage.org/swh/infra/swh-apps/web:20231024.1
               command:
               - /opt/swh/entrypoint.sh
               args:
-              # - shell
-              # - sleep
-              # - infinity
-              - refresh
+              - sync-mailmaps
+              - --perform
+              - 'host=db1.internal.staging.swh.network port=5432 user=swhmailmap dbname=swh password=${POSTGRESQL_MAILMAP_PASSWORD}'
               env:
                 - name: STATSD_HOST
                   value: prometheus-statsd-exporter
                 - name: STATSD_PORT
                   value: "9125"
                 - name: SWH_CONFIG_FILENAME
                   value: /etc/swh/config.yml
                 - name: LOG_LEVEL
                   value: INFO
+
+                - name: POSTGRESQL_MAILMAP_PASSWORD
+                  valueFrom:
+                    secretKeyRef:
+                      name: swh-postgresql-syncmailmap-secret
+                      key: postgres-syncmailmap-password
+                      # 'name' secret must exist & include that ^ key
+                      optional: false
+
                 - name: SWH_SENTRY_ENVIRONMENT
                   value: staging
                 - name: SWH_MAIN_PACKAGE
                   value: swh.web
                 - name: SWH_SENTRY_DSN
                   valueFrom:
                     secretKeyRef:
                       name: common-secrets
                       key: web-sentry-dsn
                       # if the setting doesn't exist, sentry issue pushes will be disabled


------------- diff for environment staging namespace swh-cassandra -------------

No differences


------------- diff for environment staging namespace swh-cassandra-next-version -------------

No differences


------------- diff for environment production namespace swh -------------

No differences


------------- diff for environment production namespace swh-cassandra -------------

No differences

Refs. swh/infra/sysadm-environment#4780 (closed)

Edited by Antoine R. Dumont

Merge request reports

Loading