Skip to content

Commit

Permalink
refactor: use glueops helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandoataoldotcom authored Oct 26, 2023
1 parent a96c634 commit 80e20f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 38 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM python:3.11.6-alpine3.18

RUN pip install --upgrade pip

COPY requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
Expand Down
25 changes: 5 additions & 20 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
import logging
import os
import time

import requests
from glueops.setup_logging import configure as go_configure_logging
from kubernetes import client, config

from src.get_github_api_token import get_github_api_token
from src.json_log_formatter import JsonFormatter

#=== configure logging
# json formatter
json_formatter = JsonFormatter()

# stream handler
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(json_formatter)
stream_handler.setLevel(os.getenv(
'PYTHON_LOG_LEVEL',
'INFO'
))

# configure logger
logger = logging.getLogger('PULL_REQUEST_BOT')
logger.setLevel(os.getenv(
'PYTHON_LOG_LEVEL',
'INFO'
))
logger.addHandler(stream_handler)
logger = go_configure_logging(
name='PULL_REQUEST_BOT',
level=os.getenv('PYTHON_LOG_LEVEL', 'INFO')
)

# setting cluster config
try:
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jwt==1.3.1
kubernetes==27.2.0
requests==2.31.0
requests==2.31.0
glueops-helpers @ https://github.com/GlueOps/python-glueops-helpers-library/archive/refs/tags/v0.2.0.zip
17 changes: 0 additions & 17 deletions src/json_log_formatter.py

This file was deleted.

0 comments on commit 80e20f0

Please sign in to comment.