Skip to content
Snippets Groups Projects
Commit 893cde9a authored by Lukas Köhler's avatar Lukas Köhler
Browse files

finaly new validator

parent 4ffe9141
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,6 @@ FOLDER = '/tmp/1_3wrqhvuj/'
def validate(job):
global FOLDER
my_init(job)
FOLDER = FOLDER[0:-1]
if not DEBUG:
for fname in os.listdir('.'):
......@@ -43,6 +42,8 @@ def validate(job):
paramFolder = FOLDER.split('/')[-1]
if paramFolder == "":
paramFolder = FOLDER.split('/')[-2]
if paramFolder == "":
paramFolder = FOLDER.split('/')[-3]
queue_number = server.build_job(JOB_NAME, {'folder': '/opensubmit/' + paramFolder})
queue_item = server.get_queue_item(queue_number)
......@@ -99,14 +100,11 @@ def my_init(job):
COURSE_AND_ASSIGNMENT = COURSE + '-' + ASSIGNMENT
JOB_NAME = COURSE + '-' + ASSIGNMENT + '-' + USERNAME
while len([name for name in os.listdir(FOLDER) if os.path.isdir(name)]) == 1:
print(FOLDER)
print(os.listdir(FOLDER)[0])
FOLDER = os.listdir(FOLDER)[0]
print(FOLDER)
print(os.listdir(FOLDER)[0])
fileNameList = [name for name in os.listdir(FOLDER) if
'__pycache__' not in name and '.py' not in name and '.zip' not in name]
while len(fileNameList) == 1 and os.path.isdir(os.path.join(FOLDER, fileNameList[0])):
FOLDER = os.path.join(FOLDER, fileNameList[0])
print(FOLDER)
job.working_dir = FOLDER
os.system('scp -i /ssh/key -r ' + FOLDER + ' jenkins-ssh@jenkins-ssh:/opensubmit')
os.system('chmod -R 777 ' + FOLDER)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment