skip clone

This commit is contained in:
Usman Nasir
2020-04-11 15:31:01 +05:00
parent 4a15bcab80
commit 9e93da5839
2 changed files with 21 additions and 32 deletions

View File

@@ -191,7 +191,7 @@ fi
if [ $SERVER_OS = "CentOS7" ] ; then if [ $SERVER_OS = "CentOS7" ] ; then
yum -y install yum-utils yum -y install yum-utils
yum -y groupinstall development yum -y groupinstall development
yum -y install python36u python36u-pip python36u-devel yum -y install python36u python36u-pip python36u-devel openssl-devel MariaDB-shared mariadb-devel
elif [ $SERVER_OS = "CentOS8" ] ; then elif [ $SERVER_OS = "CentOS8" ] ; then
yum install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git platform-python-devel tar yum install -y wget strace htop net-tools telnet curl which bc telnet htop libevent-devel gcc libattr-devel xz-devel mariadb-devel curl-devel git platform-python-devel tar
dnf --enablerepo=PowerTools install gpgme-devel -y dnf --enablerepo=PowerTools install gpgme-devel -y

View File

@@ -1272,37 +1272,35 @@ class Upgrade:
## Extract Latest files ## Extract Latest files
os.chdir('/usr/local') os.chdir('/usr/local/CyberCP')
if os.path.exists('cyberpanel'): command = 'git config --global user.email "support@cyberpanel.met"'
shutil.rmtree('cyberpanel') Upgrade.executioner(command, command, 1)
### check if imunify exists command = 'git config --global user.name "CyberPanel"'
Upgrade.executioner(command, command, 1)
imunifyPublic = '/usr/local/CyberCP/public/imunify' command = 'git status'
imunifyPublicBackup = '/usr/local' currentBranch = subprocess.check_output(shlex.split(command)).decode()
try: if currentBranch.find('On branch %s' % (branch)) > -1:
if os.path.exists(imunifyPublic): command = 'git stash'
shutil.move(imunifyPublic, imunifyPublicBackup) Upgrade.executioner(command, command, 1)
except: command = 'git pull'
pass Upgrade.executioner(command, command, 1)
if os.path.exists('CyberCP'): else:
shutil.rmtree('CyberCP') command = 'git stash'
Upgrade.executioner(command, command, 1)
command = 'git clone https://github.com/usmannasir/cyberpanel'
Upgrade.executioner(command, 'Download CyberPanel', 1)
shutil.move('cyberpanel', 'CyberCP')
if branch != 'stable':
os.chdir('CyberCP')
command = 'git checkout %s' % (branch) command = 'git checkout %s' % (branch)
Upgrade.executioner(command, command, 1) Upgrade.executioner(command, command, 1)
os.chdir('/usr/local')
command = 'git pull'
Upgrade.executioner(command, command, 1)
## Copy settings file ## Copy settings file
@@ -2148,18 +2146,9 @@ vmail
time.sleep(3) time.sleep(3)
## Upgrade version ## Upgrade version
Upgrade.fixPermissions() Upgrade.fixPermissions()
### get back imunify
imunifyPublicBackup = '/usr/local'
imunifyPublicBackup = '%s/imunify' % (imunifyPublicBackup)
try:
shutil.move(imunifyPublicBackup, '/usr/local/CyberCP/public')
except:
pass
## ##
Upgrade.upgradeVersion() Upgrade.upgradeVersion()