monthly forderungen

This commit is contained in:
2021-02-22 17:23:42 +01:00
parent 04548d428e
commit cf7599c8a9
2 changed files with 60 additions and 1 deletions

37
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,37 @@
stages:
- check
- dockerize
variables:
IMAGE_NAME: $CI_REGISTRY/$CI_PROJECT_PATH
check:
image: registry.hottis.de/dockerized/base-build-env:latest
stage: check
tags:
- hottis
- linux
- docker
rules:
- if: $CI_COMMIT_TAG
script:
- checksemver.py -v
--versionToValidate "$CI_COMMIT_TAG"
--validateMessage
--messageToValidate "$CI_COMMIT_MESSAGE"
dockerize:
image: registry.hottis.de/dockerized/docker-bash:latest
stage: dockerize
tags:
- hottis
- linux
- docker
rules:
- if: $CI_COMMIT_TAG
script:
- docker build --tag $IMAGE_NAME:latest --tag $IMAGE_NAME:$CI_COMMIT_TAG .
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker push $IMAGE_NAME:latest
- docker push $IMAGE_NAME:$CI_COMMIT_TAG

View File

@ -1,3 +1,25 @@
#!/usr/bin/python3
print("Monatliche Forderung eintragen")
import requests
import datetime
class ResourceNotFoundException(Exception): pass
def postJson(url):
resp = requests.post(url)
if resp.status_code != 202:
raise ResourceNotFoundException("URL: {}, Code: {}".format(url, resp.status_code))
return resp.json()
BASE_URL = "http://172.16.10.29:5000/hv"
URL_INSERT_FORDERUNGEN = "{base}/forderung/insertAllForMonth"
TEMPLATE_FILE = "inserted.tmpl"
try:
postJson(URL_INSERT_FORDERUNGEN.format(base=BASE_URL))
print("Monatliche Mietforderungen erfolgreich eintragen")
except Exception as e:
print("ERROR: {}".format(e))