gcp-platforms-auto 0.6.5__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/PKG-INFO +1 -1
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto/git.py +9 -1
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/PKG-INFO +1 -1
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/pyproject.toml +1 -1
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/README.md +0 -0
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto/__init__.py +0 -0
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/SOURCES.txt +0 -0
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/dependency_links.txt +0 -0
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/requires.txt +0 -0
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/top_level.txt +0 -0
- {gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/setup.cfg +0 -0
|
@@ -2,7 +2,7 @@ import logging
|
|
|
2
2
|
import time
|
|
3
3
|
import jwt
|
|
4
4
|
import google.cloud.logging
|
|
5
|
-
from git import Repo, NoSuchPathError
|
|
5
|
+
from git import Repo, NoSuchPathError, GitCommandError
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
import requests
|
|
8
8
|
|
|
@@ -58,6 +58,10 @@ def get_repo(path_of_git_repo, branch="main", path_to_local_repo="/tmp/repo"):
|
|
|
58
58
|
except NoSuchPathError:
|
|
59
59
|
logger.error("Repository path does not exist. Cloning fresh repository.")
|
|
60
60
|
return Repo.clone_from(path_of_git_repo, str(path_to_local_repo), branch=branch)
|
|
61
|
+
except GitCommandError as e:
|
|
62
|
+
logger.error(f"Error pulling repo (command error), trying again")
|
|
63
|
+
time.sleep(5)
|
|
64
|
+
get_repo(path_of_git_repo, branch, path_to_local_repo)
|
|
61
65
|
except Exception as e:
|
|
62
66
|
logger.exception(f"Error accessing repo: {str(e)}")
|
|
63
67
|
raise e
|
|
@@ -83,6 +87,10 @@ def git_push(repo, commit_message, files_to_push=None, branch="main"):
|
|
|
83
87
|
logger.info(f"Git push info: No update {info.summary}")
|
|
84
88
|
|
|
85
89
|
logger.info("Successfully pushed changes to Git.")
|
|
90
|
+
except GitCommandError as e:
|
|
91
|
+
logger.error(f"Error pushing to Git (command error), trying again")
|
|
92
|
+
time.sleep(5)
|
|
93
|
+
git_push(repo, commit_message, files_to_push, branch)
|
|
86
94
|
except Exception as e:
|
|
87
95
|
logger.exception(f"Error pushing to Git: {str(e)}")
|
|
88
96
|
raise e
|
|
File without changes
|
|
File without changes
|
{gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/requires.txt
RENAMED
|
File without changes
|
{gcp_platforms_auto-0.6.5 → gcp_platforms_auto-0.7.0}/gcp_platforms_auto.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|