Skip to content

Commit

Permalink
Fix: Big logorotate ourselves for different platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
bokysan committed Oct 27, 2023
1 parent 4ec0129 commit 6da38c0
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/actions/build-logrotate/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Build the logrotate'
description: 'Build the latest version of logrotate'

runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: blacklabelops/logrotate
path: 'logrotate'
ref: 'fdab0abc0b3f2917052e5d509e14e2b71d7fd9b3' # Latest commit we know that works

# Buildkit setup
- uses: ./.github/actions/buildx-setup

# Docker hub login
- uses: ./.github/actions/docker-hub-login
with:
DOCKER_ACCESS_TOKEN: '${{ inputs.DOCKER_ACCESS_TOKEN }}'

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-logrotate-${{ github.sha }}
restore-keys: |
${{ runner.os }}-logrotate-
- name: Build and push
uses: docker/build-push-action@v5
with:
context: logrotate
push: true
tags: '${{ inputs.tags }}'
platforms: "linux/arm/v6,linux/arm/v7,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
cache-from: type=local,src=/tmp/.buildx-cache/logrotate,mode=max,compression=estargz
cache-to: type=local,dest=/tmp/.buildx-cache-new/logrotate

- name: Move cache
shell: bash
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
15 changes: 15 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ jobs:

- uses: ./.github/actions/helm-chart-tests

Build_Logrotate:
runs-on: ubuntu-latest
needs:
- Helm_chart_Tests
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/actions/build-logrotate
with:
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
tags: |
boky/logrotate:latest
boky/logrotate:edge
Build_PostfixExporter:
runs-on: ubuntu-latest
needs:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ jobs:

- uses: ./.github/actions/helm-chart-tests

Build_Logrotate:
runs-on: ubuntu-latest
needs:
- Helm_chart_Tests
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/actions/build-logrotate
with:
DOCKER_ACCESS_TOKEN: '${{ secrets.DOCKER_ACCESS_TOKEN }}'
tags: |
boky/logrotate:latest
boky/logrotate:edge
Build_PostfixExporter:
runs-on: ubuntu-latest
needs:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ or

```shell script
helm repo add bokysan https://bokysan.github.io/docker-postfix/
helm upgrade --install --set persistence.enabled=false --set config.general.ALLOW_EMPTY_SENDER_DOMAINS=1 mail bokysan/mail
helm upgrade --install --set persistence.enabled=false --set config.general.ALLOW_EMPTY_SENDER_DOMAINS=yes mail bokysan/mail
```

You can also find this image at [ArtifactHub](https://artifacthub.io/packages/helm/docker-postfix/mail).
Expand Down
4 changes: 2 additions & 2 deletions helm/mail/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ spec:
- name: metrics-config
mountPath: /etc/rsyslog.d-metrics/maillog.conf
subPath: maillog.conf
- name: {{ $fullName }}
- name: {{ $fullName | quote }}
mountPath: {{ regexFind "^/?.*/" .Values.metrics.maillog | quote }}
readOnly: false
subPath: logs
Expand Down Expand Up @@ -214,7 +214,7 @@ spec:
{{- if .Values.metrics.enabled }}
- name: metrics-config
configMap:
name: metrics-config
name: {{ print $fullName "-metrics" | quote }}
{{- end }}
{{- if .Values.extraVolumes }}{{- toYaml .Values.extraVolumes | nindent 8 }}{{ end }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
Expand Down
2 changes: 1 addition & 1 deletion helm/mail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ metrics:
logrotate:
enabled: true
image:
repository: "blacklabelops/logrotate"
repository: "boky/logrotate"
tag: "latest"
logrotate.conf: |
/var/log/mail.log {
Expand Down
2 changes: 1 addition & 1 deletion scripts/common-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ postfix_setup_sender_domains() {
# Since we are behind closed doors, let's just permit all relays.
do_postconf -e "smtpd_relay_restrictions=permit"
elif [ -z "$ALLOW_EMPTY_SENDER_DOMAINS" ]; then
error "You need to specify ALLOWED_SENDER_DOMAINS otherwise Postfix will not run!"
error "You need to specify ${emphasis}ALLOWED_SENDER_DOMAINS${reset} or ${emphasis}ALLOW_EMPTY_SENDER_DOMAINS${reset}, otherwise Postfix will not run! See ${emphasis}README.md${reset} for more info."
exit 1
fi
}
Expand Down

0 comments on commit 6da38c0

Please sign in to comment.