Made CLAMAV optional
This commit is contained in:
parent
6edc31cda0
commit
023d516455
@ -7,16 +7,15 @@ stages:
|
|||||||
variables:
|
variables:
|
||||||
VERSION: latest
|
VERSION: latest
|
||||||
CACHETAG: build
|
CACHETAG: build
|
||||||
DOCKER_REGISTRY: registry.leenooks.net
|
DOCKER_HOST: tcp://${CI_REGISTRY}-leenooks-ci-docker:2375
|
||||||
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind
|
- ${CI_REGISTRY}/leenooks/ci-docker:dind
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- docker info
|
- docker info
|
||||||
- docker version
|
- docker version
|
||||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY}
|
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
@ -31,7 +30,7 @@ test:
|
|||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- chmod 500 init
|
- if [ -f init ]; then chmod 500 init; fi
|
||||||
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
|
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
|
||||||
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
|
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
|
||||||
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
||||||
|
5
init
5
init
@ -14,7 +14,10 @@ function stop {
|
|||||||
trap 'stop' SIGTERM
|
trap 'stop' SIGTERM
|
||||||
|
|
||||||
if [ "$1" == "start" ]; then
|
if [ "$1" == "start" ]; then
|
||||||
x=0; until ping -c1 ${CLAMAV} &>/dev/null; do echo "Waiting for [${CLAMAV}]..."; let x=$x+1; if [ $x -ge ${TRIES} ]; then NOTON=1; break; fi ; sleep ${WAIT}; done ; [ -n "${NOTON}" ] && echo "No [${CLAMAV}]?" && exit 1
|
if [ -z "${NO_CLAMAV}" ]; then
|
||||||
|
x=0; until ping -c1 ${CLAMAV} &>/dev/null; do echo "Waiting for [${CLAMAV}]..."; let x=$x+1; if [ $x -ge ${TRIES} ]; then NOTON=1; break; fi ; sleep ${WAIT}; done ; [ -n "${NOTON}" ] && echo "No [${CLAMAV}]?" && exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
[ -x /usr/bin/rspamd ] && exec /usr/bin/rspamd -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf -f -p /var/run/rspamd.pid &
|
[ -x /usr/bin/rspamd ] && exec /usr/bin/rspamd -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf -f -p /var/run/rspamd.pid &
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
Loading…
Reference in New Issue
Block a user