Skip to content

Commit

Permalink
Fixed th bug of the private_account when not run from the file itself.
Browse files Browse the repository at this point in the history
Added __init__ for module
  • Loading branch information
MathiasSeguy-Android2EE committed Jun 5, 2019
1 parent 21bb5cf commit 44f176e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Empty file added AndroidXMigration/__init__.py
Empty file.
Empty file added git_management/__init__.py
Empty file.
10 changes: 6 additions & 4 deletions git_management/git_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
# https://github.com/gitpython-developers/GitPython/blob/master/git/test/test_docs.py
# https://github.com/PyGithub/PyGithub
import os
from os import path
import subprocess
from shutil import copyfile
import git
from git import Actor
from git import Repo
from github import Github
import sh_command
import git_management
from git_management import sh_command
from ownStyle import GREEN, BLUE, BOLD, GREEN, RED, RESET, CYAN
#Managing private account : the file git_private_account.py is not in git
import importlib
privateAccount = importlib.util.find_spec("git_private_account")
if privateAccount is not None:
ROOT_PYTHON_PATH=path.dirname(path.abspath(__file__))
if os.path.isfile(ROOT_PYTHON_PATH+'\\git_private_account.py'):
import git_private_account
print(GREEN+" Private accounts for jenkins have been found. Using them.")
githubAccessToken = git_private_account.githubAccessToken
Expand Down Expand Up @@ -164,5 +165,6 @@ def gitCreateAndPush(repository,repoDescription):
sh_command.runGitPushInCommandLine(repository)



# print('test')
# listGitHubRepo()
Empty file added gradle_management/__init__.py
Empty file.
6 changes: 2 additions & 4 deletions jenkins_management/jenkinsTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
JENKINS_TEMPLATE_PATH=ROOT_PYTHON_PATH+"\\templates\\"

#Managing private account : the file jenkins_private_account.py is not in git
import importlib
privateAccount = importlib.util.find_spec("jenkins_private_account")
if privateAccount is not None:
if path.isfile(ROOT_PYTHON_PATH+'\\jenkins_private_account.py'):
import jenkins_private_account
print(GREEN+" Private accounts for jenkins have been found. Using them.")
GIT_ROOT_URL=jenkins_private_account.GIT_ROOT_URL
Expand Down Expand Up @@ -142,4 +140,4 @@ def createLinkedJobs(jenkinsJobs):

# createJob("MultiplicationBasile","master","clean build")
# listJobs()
# print("Test")
print("Test")

0 comments on commit 44f176e

Please sign in to comment.