diff --git a/.drone.yml b/.drone.yml index 4bc3368..dc5365f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,20 +2,6 @@ kind: pipeline name: default -steps: - - name: build image only - image: plugins/docker - settings: - repo: eumau/postfix - auto_tag: true - dry_run: true - when: - ref: - - refs/pull/** - # event no anda (?) - # event: - # - pull_request - - name: build and publish image image: plugins/docker settings: @@ -28,3 +14,41 @@ steps: when: branch: - master + +--- +kind: pipeline +name: pull_request + +steps: + - name: build image only + image: plugins/docker + settings: + repo: eumau/postfix + auto_tag: true + dry_run: true + +trigger: + event: + - pull_request + +--- +kind: pipeline +name: tags + +steps: + - name: docker + image: plugins/docker + settings: + repo: eumau/postfix + username: + from_secret: dockerhub_username + password: + from_secret: dockerhub_password + tags: + - ${DRONE_TAG} + build_args: + - DEBIAN_VERSION=${DRONE_TAG} + +trigger: + event: + - tag diff --git a/confd/conf.d/noreply.toml.disabled b/confd/conf.d/noreply.toml.disabled new file mode 100644 index 0000000..8379c88 --- /dev/null +++ b/confd/conf.d/noreply.toml.disabled @@ -0,0 +1,7 @@ +[template] +src = "noreply.tmpl" +dest = "/etc/postfix/noreply" +keys = [ +"/noreply/aliases", +"/virtual/mailbox/domains", +] diff --git a/confd/templates/noreply.tmpl b/confd/templates/noreply.tmpl new file mode 100644 index 0000000..fcbf725 --- /dev/null +++ b/confd/templates/noreply.tmpl @@ -0,0 +1,10 @@ +# "no-reply" mail aliases. +# DO NOT edit this file, it will be overwritten. +# Instead, set the variable NOREPLY_ALIASES +{{ range split (getv "/noreply/aliases") " " }} +{{ if (strings.Contains . "@") }} +{{.}} _dev_null +{{ else }} +{{.}}@{{ index (split (getv "/virtual/mailbox/domains") " ") 0 }} _dev_null +{{ end }} +{{ end }}