monthly forderungen
This commit is contained in:
37
.gitlab-ci.yml
Normal file
37
.gitlab-ci.yml
Normal 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
|
@ -1,3 +1,25 @@
|
|||||||
#!/usr/bin/python3
|
#!/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))
|
||||||
|
Reference in New Issue
Block a user