Skip to content

Commit

Permalink
bug fix git
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Feb 14, 2020
1 parent b969caa commit 5631ed7
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions plogical/applicationInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def __init__(self, installApp, extraArgs):
self.installApp = installApp
self.extraArgs = extraArgs
if extraArgs != None:
self.tempStatusPath = self.extraArgs['tempStatusPath']
try:
self.tempStatusPath = self.extraArgs['tempStatusPath']
except:
pass

def run(self):
try:
Expand Down Expand Up @@ -629,7 +632,12 @@ def setupGit(self):

try:
command = 'git clone --depth 1 --no-single-branch git@' + defaultProvider + '.com:' + username + '/' + reponame + '.git -b ' + branch + ' ' + finalPath
ProcessUtilities.executioner(command, externalApp)
output = ProcessUtilities.outputExecutioner(command, externalApp)
if output.find('Checking out files: 100%') == -1:
statusFile = open(tempStatusPath, 'w')
statusFile.writelines('%s. [404]' % (output))
statusFile.close()
return 0
except subprocess.CalledProcessError as msg:
statusFile = open(tempStatusPath, 'w')
statusFile.writelines(
Expand Down Expand Up @@ -684,15 +692,15 @@ def gitPull(self):
logging.writeToFile('Git is not setup for this website.')
return 0

command = 'sudo git --git-dir=' + finalPath + '.git --work-tree=' + finalPath + ' pull'
command = 'git --git-dir=' + finalPath + '.git --work-tree=' + finalPath + ' pull'
ProcessUtilities.executioner(command, externalApp)

##

website = Websites.objects.get(domain=domain)
externalApp = website.externalApp

command = "sudo chown -R " + externalApp + ":" + externalApp + " " + finalPath
command = "chown -R " + externalApp + ":" + externalApp + " " + finalPath
ProcessUtilities.executioner(command, externalApp)

return 0
Expand Down Expand Up @@ -723,15 +731,15 @@ def detachRepo(self):
childDomain = ChildDomains.objects.get(domain=domain)
finalPath = childDomain.path

command = 'sudo rm -rf ' + finalPath
command = 'rm -rf ' + finalPath
ProcessUtilities.executioner(command, website.externalApp)

command = 'sudo mkdir ' + finalPath
command = 'mkdir ' + finalPath
ProcessUtilities.executioner(command, website.externalApp)

##

command = "sudo chown -R " + externalApp + ":" + externalApp + " " + finalPath
command = "chown -R " + externalApp + ":" + externalApp + " " + finalPath
ProcessUtilities.executioner(command, website.externalApp)

gitPath = '/home/cyberpanel/' + domain + '.git'
Expand Down

0 comments on commit 5631ed7

Please sign in to comment.