Add crontab to project
Cron will likely be a duplicate compose service with a different command.
This commit is contained in:
parent
2fe0960623
commit
10b32da3e0
4 changed files with 16 additions and 1 deletions
|
@ -132,3 +132,12 @@ pip_tools:
|
||||||
- ./scripts/compile-requirements.sh
|
- ./scripts/compile-requirements.sh
|
||||||
- git diff
|
- git diff
|
||||||
- git diff-index --quiet HEAD --
|
- git diff-index --quiet HEAD --
|
||||||
|
|
||||||
|
crontab:
|
||||||
|
image: alpine
|
||||||
|
stage: test
|
||||||
|
dependencies: []
|
||||||
|
before_script:
|
||||||
|
- apk add --no-cache supercronic
|
||||||
|
script:
|
||||||
|
- supercronic -test etc/crontab
|
||||||
|
|
|
@ -17,6 +17,8 @@ RUN useradd website --create-home -u 1000 && mkdir /app $VIRTUAL_ENV && chown -R
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN wget https://github.com/aptible/supercronic/releases/download/v0.2.1/supercronic-linux-amd64 -O /usr/local/bin/supercronic && chmod +x /usr/local/bin/supercronic
|
||||||
|
|
||||||
ENV PATH=${POETRY_HOME}/bin:$VIRTUAL_ENV/bin:$PATH \
|
ENV PATH=${POETRY_HOME}/bin:$VIRTUAL_ENV/bin:$PATH \
|
||||||
PYTHONUNBUFFERED=1
|
PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
|
4
etc/crontab
Normal file
4
etc/crontab
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
@weekly ./manage.py update_index
|
||||||
|
@daily ./manage.py clearsessions
|
||||||
|
@daily ./manage.py update_unsplash_photos
|
||||||
|
*/10 * * * * ./manage.py publish_scheduled_pages
|
|
@ -163,7 +163,7 @@ WAGTAIL_SITE_NAME = "website"
|
||||||
WAGTAILSEARCH_BACKENDS = {
|
WAGTAILSEARCH_BACKENDS = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "wagtail.search.backends.database",
|
"BACKEND": "wagtail.search.backends.database",
|
||||||
"AUTO_UPDATE": DEBUG,
|
"AUTO_UPDATE": True,
|
||||||
"ATOMIC_REBUILD": True,
|
"ATOMIC_REBUILD": True,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue