|
@@ -398,20 +398,20 @@ def add_server_views():
|
|
|
username = session['uname']
|
|
|
L = []
|
|
|
if request.method == 'GET':
|
|
|
- # os.system('git clone -b sh --single-branch http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files.git C:\\Users\\USER\\Rita\\operating\\sixthproject\\new')
|
|
|
- # with open('../new/coffeesystem.sh', encoding='utf-8') as f:
|
|
|
- # D['command'] = f.read().split('\n')
|
|
|
- # # print("D['command']: ", D['command'])
|
|
|
+ os.system('git clone -b sh --single-branch http://60.250.156.230:3000/Automatic_build_system/Automatically_install_files.git C:\\Users\\USER\\Rita\\operating\\sixthproject\\new')
|
|
|
+ with open('../new/coffeesystem.sh', encoding='utf-8') as f:
|
|
|
+ D['command'] = f.read().split('\n')
|
|
|
+ # print("D['command']: ", D['command'])
|
|
|
|
|
|
- # shutil.rmtree('../new', onerror=remove_readonly)
|
|
|
- # sl(3)
|
|
|
+ shutil.rmtree('../new', onerror=remove_readonly)
|
|
|
+ sl(3)
|
|
|
|
|
|
- # L2= []
|
|
|
- # for i in range(0, len(D['command'])):
|
|
|
- # if D['command'][i] == "'" or D['command'][i] == '' or "#" in D['command'][i] or D['command'][i] == ' ':
|
|
|
- # continue
|
|
|
- # L2.append(D['command'][i])
|
|
|
- # D['command'] = L2
|
|
|
+ L2= []
|
|
|
+ for i in range(0, len(D['command'])):
|
|
|
+ if D['command'][i] == "'" or D['command'][i] == '' or "#" in D['command'][i] or D['command'][i] == ' ':
|
|
|
+ continue
|
|
|
+ L2.append(D['command'][i])
|
|
|
+ D['command'] = L2
|
|
|
|
|
|
# ===========================================================================================================
|
|
|
|
|
@@ -461,16 +461,16 @@ def add_server_views():
|
|
|
csvWriter = csv.writer(csvFile)
|
|
|
csvWriter.writerow(['Command', 'Install Content', 'Time', 'Status'])
|
|
|
|
|
|
- # # Rita TEST
|
|
|
- D['command'] = [
|
|
|
- # 'cd /home/使用者;pwd;sudo git clone -b git_repo --single-branch http://60.250.156.230:3000/Automatic_build_system/git_mysql.git',
|
|
|
- # 'cd /home/使用者/git_mysql/;pwd;sudo mv gogs.tar.gz /home/使用者/;sudo mv repo.tar.gz /home/使用者/',
|
|
|
- # 'cd /home/使用者;pwd;sudo tar -zxvf /home/使用者/gogs.tar.gz;sudo tar -zxvf /home/使用者/repo.tar.gz ;sudo mv /home/使用者/git_mysql/app.ini /home/使用者/gogs/custom/conf/',
|
|
|
- # 'sudo git config --global --add safe.directory /home/使用者/gogs-repositories/admin1/sh.git'
|
|
|
- 'cd /home/' + username + '/gogs/custom/conf/;' + \
|
|
|
- 'pwd;' + \
|
|
|
- 'sed -i "s/使_用_者/使用者/g" app.ini'
|
|
|
- ]
|
|
|
+ # # # Rita TEST
|
|
|
+ # D['command'] = [
|
|
|
+ # # 'cd /home/使用者;pwd;sudo git clone -b git_repo --single-branch http://60.250.156.230:3000/Automatic_build_system/git_mysql.git',
|
|
|
+ # # 'cd /home/使用者/git_mysql/;pwd;sudo mv gogs.tar.gz /home/使用者/;sudo mv repo.tar.gz /home/使用者/',
|
|
|
+ # # 'cd /home/使用者;pwd;sudo tar -zxvf /home/使用者/gogs.tar.gz;sudo tar -zxvf /home/使用者/repo.tar.gz ;sudo mv /home/使用者/git_mysql/app.ini /home/使用者/gogs/custom/conf/',
|
|
|
+ # # 'sudo git config --global --add safe.directory /home/使用者/gogs-repositories/admin1/sh.git'
|
|
|
+ # 'cd /home/' + username + '/gogs/custom/conf/;' + \
|
|
|
+ # 'pwd;' + \
|
|
|
+ # 'sed -i "s/使_用_者/使用者/g" app.ini'
|
|
|
+ # ]
|
|
|
|
|
|
for command in D['command']:
|
|
|
if '使用者' in command :
|