From 8895ad20a12699cf2c390066fcf3375c4e2146dd Mon Sep 17 00:00:00 2001 From: Francis Altomare Date: Thu, 25 Oct 2018 17:50:50 +0200 Subject: [PATCH] added logging --- githubcommit/handlers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/githubcommit/handlers.py b/githubcommit/handlers.py index c493b08..97fb470 100644 --- a/githubcommit/handlers.py +++ b/githubcommit/handlers.py @@ -19,22 +19,32 @@ def put(self): # git parameters from environment variables # expand variables since Docker's will pass VAR=$VAL as $VAL without expansion git_dir = "{}/{}".format(os.path.expandvars(os.environ.get('GIT_PARENT_DIR')), os.path.expandvars(os.environ.get('GIT_REPO_NAME'))) + print("Git dir: {}".format(git_dir)) git_url = os.path.expandvars(os.environ.get('GIT_REMOTE_URL')) + print("Remote url: {}".format(git_url)) git_user = os.path.expandvars(os.environ.get('GIT_USER')) + print("User: {}".format(git_user)) git_repo_upstream = os.path.expandvars(os.environ.get('GIT_REMOTE_UPSTREAM')) + print("Repo upstream: {}".format(git_repo_upstream)) git_branch = git_remote = os.path.expandvars(os.environ.get('GIT_BRANCH_NAME')) + print("Branch: {}".format(git_branch)) git_access_token = os.path.expandvars(os.environ.get('GITHUB_ACCESS_TOKEN')) + print("Token: {}".format(git_access_token)) # get the parent directory for git operations git_dir_parent = os.path.dirname(git_dir) + print("Parent dir {}".format(git_dir_parent)) # obtain filename and msg for commit data = json.loads(self.request.body.decode('utf-8')) + print("Loaded json: {}".format(data)) filename = urllib.parse.unquote(data['filename']) + print("Filename: {}".format(filename)) msg = data['msg'] # get current directory (to return later) cwd = os.getcwd() + print("working dir {}".format(cwd)) # select branch within repo try: