Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
016ee6541c
|
|||
226c8866a3
|
|||
4b8c62ab94
|
|||
903ae3b536
|
|||
d153c6d263
|
|||
6995a8d41d
|
|||
7002128ddb
|
|||
a4ecb0e8a0
|
|||
27b2aea827
|
@ -28,6 +28,11 @@ COPY crontab /etc/
|
||||
COPY *.py ${APP_DIR}/
|
||||
COPY *.tmpl ${APP_DIR}/
|
||||
|
||||
RUN \
|
||||
chmod 644 /etc/crontab && \
|
||||
chmod 755 ${APP_DIR}/*.py && \
|
||||
chmod 644 ${APP_DIR}/*.tmpl
|
||||
|
||||
# USER 1000:1000
|
||||
WORKDIR ${APP_DIR}
|
||||
|
||||
|
4
build.sh
4
build.sh
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
IMAGE_NAME="registry.hottis.de/hv/hv-cron"
|
||||
IMAGE_NAME="local-hv-cron"
|
||||
VERSION=0.0.1
|
||||
|
||||
docker build -t ${IMAGE_NAME}:${VERSION} .
|
||||
docker push ${IMAGE_NAME}:${VERSION}
|
||||
# docker push ${IMAGE_NAME}:${VERSION}
|
||||
|
||||
|
5
crontab
5
crontab
@ -1,5 +1,6 @@
|
||||
MAILTO = wolfgang.hottgenroth@icloud.com
|
||||
CONTENT_TYPE = "text/html"
|
||||
|
||||
0 13 1 * * user /opt/app/monatliche-forderung-eintragen.py
|
||||
0 4 * * * user /opt/app/monatliche-forderung-ueberwachen.py
|
||||
0 14 1 * * user /opt/app/monatliche-forderung-eintragen.py
|
||||
0 5 * * * user /opt/app/monatliche-forderung-ueberwachen.py
|
||||
|
||||
|
@ -3,12 +3,12 @@
|
||||
import requests
|
||||
import datetime
|
||||
|
||||
class ResourceNotFoundException(Exception): pass
|
||||
class ServerException(Exception): pass
|
||||
|
||||
def postJson(url):
|
||||
resp = requests.post(url)
|
||||
if resp.status_code != 202:
|
||||
raise ResourceNotFoundException("URL: {}, Code: {}".format(url, resp.status_code))
|
||||
raise ServerException("URL: {}, Code: {}, Msg: {}".format(url, resp.status_code, resp.text))
|
||||
return resp.json()
|
||||
|
||||
|
||||
@ -23,3 +23,5 @@ try:
|
||||
print("Monatliche Mietforderungen erfolgreich eintragen")
|
||||
except Exception as e:
|
||||
print("ERROR: {}".format(e))
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user