-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from robertchoi80/main
handle all corner cases when updating thanos-sc endpoints
- Loading branch information
Showing
3 changed files
with
85 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,13 +63,18 @@ spec: | |
print("Cloning repository...") | ||
repoUrl = "https://" + os.environ['TOKEN'] + "@{{inputs.parameters.site_repo_url}}" | ||
repo = git.Repo.clone_from(repoUrl, siteDir) | ||
with repo.config_writer() as git_config: | ||
git_config.set_value('user', 'email', '[email protected]') | ||
git_config.set_value('user', 'name', 'TKS Argo') | ||
print("Cloned repo contents:") | ||
os.system("ls -al {}".format(sitePath)) | ||
os.system("ls -al {}/{}".format(sitePath, clusterName)) | ||
try: | ||
repo = git.Repo.clone_from(repoUrl, siteDir) | ||
with repo.config_writer() as git_config: | ||
git_config.set_value('user', 'email', '[email protected]') | ||
git_config.set_value('user', 'name', 'TKS Argo') | ||
print("Cloned repo contents:") | ||
os.system("ls -al {}".format(sitePath)) | ||
os.system("ls -al {}/{}".format(sitePath, clusterName)) | ||
except git.exc.GitCommandError as e: | ||
print("Repository {} doesn't exist. Skipping..".format(repoUrl)) | ||
print(e) | ||
sys.exit(0) | ||
else: | ||
print("The repo already exists. Pulling latest updates..") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters