From 657cde9705c9672ff256a2a026e4adb57f4a045a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20K=C3=B6hler?= <lukas.koehler@h-da.de> Date: Mon, 27 Aug 2018 22:02:59 +0200 Subject: [PATCH] updates --- .../Praktikum 1/jenkinsfile.groovy | 22 ++++++-- .../Praktikum 2/jenkinsfile.groovy | 52 ++----------------- validationScripts/validate.py | 5 +- 3 files changed, 25 insertions(+), 54 deletions(-) diff --git a/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy b/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy index a375afc..f2d1beb 100644 --- a/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy +++ b/pipelines/PAD2 Repetitorium/Praktikum 1/jenkinsfile.groovy @@ -69,11 +69,25 @@ node { ) } stage('Pull and compile cppunit tests') { - git( - credentialsId: 'codegit', - url: 'https://code.fbi.h-da.de/SS18-REP-PAD2/UnitTests/Praktikum1.git' + sh( + ''' + mkdir git + ''' ) - sh(''' + dir('git') { + git( + credentialsId: 'codegit', + url: 'https://code.fbi.h-da.de/SS18-REP-PAD2/UnitTests/Praktikum1.git', + changelog: false + ) + } + sh( + ''' + cp -r git/* ./ + ''' + ) + sh( + ''' cmake ./ make ''' diff --git a/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy b/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy index b30714a..fd11ecb 100644 --- a/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy +++ b/pipelines/PAD2 Repetitorium/Praktikum 2/jenkinsfile.groovy @@ -1,10 +1,5 @@ node { stage('Copy files') { - sh( - ''' - ls -la - ''' - ) sh( ''' chmod -Rf 777 ./ @@ -14,35 +9,15 @@ node { rm -rf \$folder ''' ) - sh( - ''' - ls -la - ''' - ) } stage('Build') { - sh( - ''' - ls -la - ''' - ) sh( ''' clang++ -std=c++11 -O0 -g -Wall -Wextra -Weverything -Wno-c++98-compat -o binary *.cpp ''' ) - sh( - ''' - ls -la - ''' - ) } stage('Collect warnings') { - sh( - ''' - ls -la - ''' - ) warnings( canComputeNew: false, canResolveRelativePaths: false, @@ -57,11 +32,6 @@ node { ) } stage('Run valgrind') { - sh( - ''' - ls -la - ''' - ) runValgrind( childSilentAfterFork: false, excludePattern: '', @@ -97,16 +67,10 @@ node { unstableThresholdInvalidReadWrite: '0', unstableThresholdTotal: '0' ) - sh( - ''' - ls -la - ''' - ) } stage('Pull and compile cppunit tests') { sh( ''' - ls -la mkdir git ''' ) @@ -114,28 +78,20 @@ node { git( credentialsId: 'codegit', url: 'https://code.fbi.h-da.de/SS18-REP-PAD2/UnitTests/Praktikum2.git', - changelog: false, - poll: false, - wipeOutWorkspace: false + changelog: false ) } - sh( ''' - cp -r git/* ./ - ls -la + cp -r git/* ./ ''' ) - sh(''' + sh( + ''' cmake ./ make ''' ) - sh( - ''' - ls -la - ''' - ) } stage('Run cppunit tests') { sh('./cppunitTemplate') diff --git a/validationScripts/validate.py b/validationScripts/validate.py index 6c82d9e..b36e4ea 100644 --- a/validationScripts/validate.py +++ b/validationScripts/validate.py @@ -17,8 +17,6 @@ JENKINS_URL = 'https://jenkins-open-submit.apps.ocp.fbi.h-da.de' JENKINS_USERNAME = 'api' JENKINS_SECRET = os.environ['JENKINS_API_TOKEN'] -print (os.environ['JENKINS_API_TOKEN']) - # Parameter that will be filled when debug is off USERNAME = 'istlukoeh' COURSE = 'PAD1' @@ -44,6 +42,8 @@ def validate(job): server = Jenkins(JENKINS_URL, JENKINS_USERNAME, JENKINS_SECRET) create_pipeline(server) + #TODO: FOLDER.split('/')[:-1] wahrscheinlich eher + # und makefile noch mal überprüfen queue_number = server.build_job(JOB_NAME, {'folder': '/opensubmit/' + FOLDER.split('/')[2]}) queue_item = server.get_queue_item(queue_number) @@ -100,6 +100,7 @@ def my_init(job): COURSE_AND_ASSIGNMENT = COURSE + '-' + ASSIGNMENT JOB_NAME = COURSE + '-' + ASSIGNMENT + '-' + USERNAME + print (FOLDER) os.system('scp -i /ssh/key -r ' + FOLDER + ' jenkins-ssh@jenkins-ssh:/opensubmit') os.system('chmod -R 777 ' + FOLDER) -- GitLab