2021-08-07 20:24:58 +02:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
workspace:
|
|
|
|
path: /drone/src
|
|
|
|
|
|
|
|
steps:
|
2022-08-13 12:30:20 +02:00
|
|
|
- name: LOG_LEVEL var set to debug
|
|
|
|
depends_on:
|
|
|
|
- clone
|
|
|
|
image: python:3.10-alpine
|
2021-08-07 20:24:58 +02:00
|
|
|
pull: if-not-exists
|
|
|
|
environment:
|
2022-08-13 12:30:20 +02:00
|
|
|
LOG_LEVEL: 'debug'
|
2021-08-07 20:24:58 +02:00
|
|
|
TZ: 'Europe/Berlin'
|
|
|
|
commands:
|
|
|
|
- apk --no-cache add gcc musl-dev tzdata
|
|
|
|
- pip3 install --no-cache-dir -r requirements.txt
|
2022-08-13 12:30:20 +02:00
|
|
|
- echo "$LOG_LEVEL"
|
2021-08-07 20:52:05 +02:00
|
|
|
- |
|
|
|
|
python3 -c 'from loghandler import logger;
|
|
|
|
def main():
|
|
|
|
logger.debug("This is a Debug Message")
|
|
|
|
logger.info("This is a Info Message")
|
|
|
|
logger.warning("This is a Warning Message")
|
|
|
|
logger.error("This is a Error Message")
|
|
|
|
logger.critical("This is a Critical Message")
|
|
|
|
|
|
|
|
main()'
|
2021-08-08 14:22:12 +02:00
|
|
|
|
2022-08-13 12:30:20 +02:00
|
|
|
- name: LOG_LEVEL var set to warning
|
|
|
|
depends_on:
|
|
|
|
- clone
|
|
|
|
image: python:3.10-alpine
|
2021-08-08 14:22:12 +02:00
|
|
|
pull: if-not-exists
|
|
|
|
environment:
|
2022-08-13 12:30:20 +02:00
|
|
|
LOG_LEVEL: 'warning'
|
2021-08-08 14:22:12 +02:00
|
|
|
TZ: 'Europe/Berlin'
|
|
|
|
commands:
|
|
|
|
- apk --no-cache add gcc musl-dev tzdata
|
|
|
|
- pip3 install --no-cache-dir -r requirements.txt
|
2022-08-13 12:30:20 +02:00
|
|
|
- echo "$LOG_LEVEL"
|
|
|
|
- |
|
|
|
|
python3 -c 'from loghandler import logger;
|
|
|
|
def main():
|
|
|
|
logger.debug("This is a Debug Message")
|
|
|
|
logger.info("This is a Info Message")
|
|
|
|
logger.warning("This is a Warning Message")
|
|
|
|
logger.error("This is a Error Message")
|
|
|
|
logger.critical("This is a Critical Message")
|
|
|
|
|
|
|
|
main()'
|
|
|
|
|
|
|
|
- name: Unset LOG_LEVEL var
|
|
|
|
depends_on:
|
|
|
|
- clone
|
|
|
|
image: python:3.10-alpine
|
|
|
|
pull: if-not-exists
|
|
|
|
environment:
|
|
|
|
TZ: 'Europe/Berlin'
|
|
|
|
commands:
|
|
|
|
- apk --no-cache add gcc musl-dev tzdata
|
|
|
|
- pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
- echo "$LOG_LEVEL"
|
2021-08-08 14:22:12 +02:00
|
|
|
- |
|
|
|
|
python3 -c 'from loghandler import logger;
|
|
|
|
def main():
|
|
|
|
logger.debug("This is a Debug Message")
|
|
|
|
logger.info("This is a Info Message")
|
|
|
|
logger.warning("This is a Warning Message")
|
|
|
|
logger.error("This is a Error Message")
|
|
|
|
logger.critical("This is a Critical Message")
|
|
|
|
|
|
|
|
main()'
|