[ADD]Odoo backups : add optional healthchecks URL
This commit is contained in:
parent
5e3437cc6e
commit
1c41f871a0
@ -8,7 +8,7 @@ WORKDIR /home/odoo
|
|||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN mkdir backups
|
RUN mkdir backups
|
||||||
RUN apt-get install -y --no-install-recommends cron gettext-base
|
RUN apt-get install -y --no-install-recommends cron gettext-base curl
|
||||||
|
|
||||||
# Avoid overlayfs bug with tail
|
# Avoid overlayfs bug with tail
|
||||||
VOLUME /var/log
|
VOLUME /var/log
|
||||||
@ -16,6 +16,7 @@ VOLUME /var/log
|
|||||||
COPY crontab ./crontab
|
COPY crontab ./crontab
|
||||||
|
|
||||||
COPY backup.template .
|
COPY backup.template .
|
||||||
|
COPY hc.template .
|
||||||
COPY plan.py .
|
COPY plan.py .
|
||||||
COPY launch.sh .
|
COPY launch.sh .
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ WORKDIR /home/odoo
|
|||||||
USER root
|
USER root
|
||||||
|
|
||||||
RUN mkdir backups
|
RUN mkdir backups
|
||||||
RUN yum install -y gettext cronie
|
RUN yum install -y gettext cronie curl
|
||||||
|
|
||||||
# Avoid overlayfs bug with tail
|
# Avoid overlayfs bug with tail
|
||||||
VOLUME /var/log
|
VOLUME /var/log
|
||||||
@ -16,6 +16,7 @@ VOLUME /var/log
|
|||||||
COPY crontab ./crontab
|
COPY crontab ./crontab
|
||||||
|
|
||||||
COPY backup.template .
|
COPY backup.template .
|
||||||
|
COPY hc.template .
|
||||||
COPY plan.py .
|
COPY plan.py .
|
||||||
COPY launch.c7.sh launch.sh
|
COPY launch.c7.sh launch.sh
|
||||||
|
|
||||||
|
1
odoo/backups/hc.template
Normal file
1
odoo/backups/hc.template
Normal file
@ -0,0 +1 @@
|
|||||||
|
curl -m 10 --retry 5 ${HC_URL}
|
@ -19,5 +19,8 @@ do
|
|||||||
envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh
|
envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh
|
||||||
((index++))
|
((index++))
|
||||||
done
|
done
|
||||||
|
if ! [ -z ${HC_URL} ]; then
|
||||||
|
envsubst < /home/odoo/hc.template >> /home/odoo/backup.sh
|
||||||
|
fi
|
||||||
chown odoo:odoo /home/odoo/backup.sh
|
chown odoo:odoo /home/odoo/backup.sh
|
||||||
crontab ./crontab && touch /var/log/cron.log && crond && tail -f /var/log/cron.log
|
crontab ./crontab && touch /var/log/cron.log && crond && tail -f /var/log/cron.log
|
||||||
|
@ -19,5 +19,8 @@ do
|
|||||||
envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh
|
envsubst < /home/odoo/backup.template >> /home/odoo/backup.sh
|
||||||
((index++))
|
((index++))
|
||||||
done
|
done
|
||||||
|
if ! [ -z ${HC_URL} ]; then
|
||||||
|
envsubst < /home/odoo/hc.template >> /home/odoo/backup.sh
|
||||||
|
fi
|
||||||
chown odoo:odoo /home/odoo/backup.sh
|
chown odoo:odoo /home/odoo/backup.sh
|
||||||
crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log
|
crontab ./crontab && touch /var/log/cron.log && cron && tail -f /var/log/cron.log
|
||||||
|
Loading…
Reference in New Issue
Block a user