Skip to content

Commit

Permalink
add mautic:contacts:scheduled_export
Browse files Browse the repository at this point in the history
  • Loading branch information
audacioustux committed Sep 25, 2024
1 parent 54fe996 commit 1e7f5fb
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tasks:
- docker buildx create --name multiarch --bootstrap --use
docker:build:
env:
VERSION: 5.1.28
VERSION: 5.1.29
cmds:
- docker build --platform linux/arm64 --builder=multiarch -t docker.io/tanjim/mautic:install-$VERSION --target=install --push .
- docker build --platform linux/arm64 --builder=multiarch -t docker.io/tanjim/mautic:console-$VERSION --target=console --push .
Expand Down
2 changes: 1 addition & 1 deletion charts/mautic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 5.1.84
version: 5.1.85

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
65 changes: 65 additions & 0 deletions charts/mautic/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ spec:
{{- end }}
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.import.env }}
env:
{{- toYaml .Values.mautic.cron.import.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
Expand Down Expand Up @@ -67,6 +71,10 @@ spec:
- flock
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.segmentsUpdate.env }}
env:
{{- toYaml .Values.mautic.cron.segmentsUpdate.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
Expand Down Expand Up @@ -109,6 +117,10 @@ spec:
- flock
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.campaignsTrigger.env }}
env:
{{- toYaml .Values.mautic.cron.campaignsTrigger.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
Expand Down Expand Up @@ -154,6 +166,10 @@ spec:
- flock
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.campaignsSummarize.env }}
env:
{{- toYaml .Values.mautic.cron.campaignsSummarize.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
Expand Down Expand Up @@ -196,6 +212,10 @@ spec:
- flock
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.campaignsRebuild.env }}
env:
{{- toYaml .Values.mautic.cron.campaignsRebuild.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
Expand Down Expand Up @@ -230,6 +250,10 @@ spec:
- flock
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.broadcastsSend.env }}
env:
{{- toYaml .Values.mautic.cron.broadcastsSend.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
Expand Down Expand Up @@ -264,6 +288,47 @@ spec:
- flock
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.messagesSend.env }}
env:
{{- toYaml .Values.mautic.cron.messagesSend.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
{{- toYaml .Values.mautic.cron.import.resources | nindent 14 }}
restartPolicy: OnFailure
volumes:
{{- include "mautic.volumes" . | nindent 12 }}
{{- end }}
---
# mautic:contacts:scheduled_export
{{- if .Values.mautic.cron.contactsScheduledExport.enabled }}
kind: CronJob
apiVersion: batch/v1
metadata:
name: {{ include "mautic.fullname" . }}-contacts-scheduled-export
labels:
{{- include "mautic.labels" . | nindent 4 }}
spec:
concurrencyPolicy: Forbid
schedule: "{{ .Values.mautic.cron.contactsScheduledExport.schedule }}"
successfulJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- name: console
image: "{{ .Values.mautic.image.repository }}:console-{{ .Values.mautic.image.tag }}"
imagePullPolicy: "{{ .Values.mautic.image.pullPolicy }}"
args:
- mautic:contacts:scheduled_export
envFrom:
{{- include "mautic.envFrom" . | nindent 14 }}
{{- if .Values.mautic.cron.contactsScheduledExport.env }}
env:
{{- toYaml .Values.mautic.cron.contactsScheduledExport.env | nindent 14 }}
{{- end }}
volumeMounts:
{{- include "mautic.volumeMounts" . | nindent 14 }}
resources:
Expand Down
24 changes: 15 additions & 9 deletions charts/mautic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mautic:
image:
repository: docker.io/tanjim/mautic
pullPolicy: IfNotPresent
tag: "5.1.28"
tag: "5.1.29"

# existingConfigMap: ""
# ignore the following values if existingConfigMap is set
Expand Down Expand Up @@ -36,16 +36,16 @@ mautic:
limits:
memory: 1Gi
requests:
cpu: 500m
memory: 512Mi
cpu: 200m
memory: 768Mi
hpa:
enabled: true
minReplicas: 1
maxReplicas: 5
targetCPU: 60
targetCPU: 80
vpa:
enabled: false
minMemory: 256Mi
minMemory: 512Mi
maxMemory: 2Gi
readinessProbe: &probe
# check if request to /s/login returns 301 (redirect) status code
Expand Down Expand Up @@ -75,9 +75,9 @@ mautic:
siteUrl: "https://localhost:8080"
resources:
limits:
memory: 384Mi
memory: 1Gi
requests:
memory: 256Mi
memory: 768Mi

db:
create: true
Expand All @@ -104,9 +104,9 @@ mautic:
# rebuild: true
resources: &cron_resources
limits:
memory: 512Mi
memory: 1Gi
requests:
memory: 128Mi
memory: 256Mi
segmentsUpdate:
enabled: true
schedule: "@every 2h"
Expand All @@ -130,6 +130,12 @@ mautic:
schedule: "*/10 * * * *"
# limit: 5000
resources: *cron_resources
contactsScheduledExport:
enabled: true
schedule: "*/10 * * * *"
resources: *cron_resources
env:
PHP_INI_VALUE_MEMORY_LIMIT: "768M"
broadcastsSend:
enabled: true
schedule: "*/5 * * * *"
Expand Down
4 changes: 2 additions & 2 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG APT_DEPS="libcurl4-gnutls-dev libc-client-dev libkrb5-dev libmcrypt-dev libs

FROM php:8.1-apache AS builder

ARG MAUTIC_VERSION=5.1
ARG MAUTIC_VERSION=5.1.1
ARG APT_DEPS

# Install PHP extensions
Expand Down Expand Up @@ -59,7 +59,7 @@ ENV PHP_INI_VALUE_DATE_TIMEZONE=UTC \
PHP_INI_VALUE_UPLOAD_MAX_FILESIZE=512M \
PHP_INI_VALUE_POST_MAX_FILESIZE=512M \
PHP_INI_VALUE_MEMORY_LIMIT=512M \
PHP_INI_VALUE_MAX_EXECUTION_TIME=300
PHP_INI_VALUE_MAX_EXECUTION_TIME=600

COPY ./common/php.ini /usr/local/etc/php/php.ini

Expand Down

0 comments on commit 1e7f5fb

Please sign in to comment.