Skip to content
Permalink
Browse files
bug fix git
  • Loading branch information
usmannasir committed Feb 14, 2020
1 parent b969caa commit 5631ed73d4c750c7a219c51263ef0d10ad4c8941
Showing 1 changed file with 15 additions and 7 deletions.
@@ -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:
@@ -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(
@@ -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
@@ -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'

0 comments on commit 5631ed7

Please sign in to comment.