From ed4e3f48e3bdfd571c2ba0a4d566109c231c4f53 Mon Sep 17 00:00:00 2001 From: Wojtek Porczyk Date: Thu, 1 Oct 2020 21:24:53 +0200 Subject: [PATCH] [CI] Fix gsc.jenkinsfile - remove unnecessary parts - fix whitespace and style --- .ci/gsc.jenkinsfile | 120 +++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 67 deletions(-) diff --git a/.ci/gsc.jenkinsfile b/.ci/gsc.jenkinsfile index b6c7613c..ffe3e010 100644 --- a/.ci/gsc.jenkinsfile +++ b/.ci/gsc.jenkinsfile @@ -1,71 +1,57 @@ pipeline { - agent { label 'sgx_bionic' } - stages { - stage('Build') { - steps { - sh ''' - cd Tools/gsc/test - # Jenkins may automatically merge master into submitted commit (but - # maybe not): choose the original submitted commit for GSC (third - # commit in below git-log output if merged or first commit if not - # merged) - export COMMIT=`git log --pretty="%H %P" -n 1 | awk '{if(!$3) \ - {print $1} else {print $3}}'` - make TESTCASES='python3 python3-trusted-args base-python3' \ - DISTRIBUTIONS='ubuntu18.04' \ - IMAGE_SUFFIX=-${COMMIT} GRAPHENE_BRANCH=${COMMIT} - ''' - } - } - stage('Test') { - steps { - sh ''' - cd Tools/gsc/test - # Jenkins may automatically merge master into submitted commit (but - # maybe not): choose the original submitted commit for GSC (third - # commit in below git-log output if merged or first commit if not merged) - export COMMIT=`git log --pretty="%H %P" -n 1 | awk '{if(!$3) \ - {print $1} else {print $3}}'` - # Test Linux Pal - make test ENV_VARS='GSC_PAL=Linux' MAXTESTNUM=2 TESTCASES=python3 \ - DISTRIBUTIONS='ubuntu18.04' IMAGE_SUFFIX=-${COMMIT} - # Test Linux-SGX PAL - make test MAXTESTNUM=3 TESTCASES='python3 python3-trusted-args' \ - DISTRIBUTIONS='ubuntu18.04' IMAGE_SUFFIX=-${COMMIT} - # Test use of base Graphene Image - make test MAXTESTNUM=2 TESTCASES='python3' \ - DISTRIBUTIONS='ubuntu18.04-base' IMAGE_SUFFIX=-${COMMIT} - ''' - } - } - stage('Deploy') { - steps { - sh 'echo Deploying code' - } - } + agent { label 'sgx_bionic' } + stages { + stage('Build') { + steps { + sh ''' + cd Tools/gsc/test + # Jenkins may automatically merge master into submitted commit (but + # maybe not): choose the original submitted commit for GSC (third + # commit in below git-log output if merged or first commit if not + # merged) + export COMMIT=`git log --pretty="%H %P" -n 1 | awk '{if(!$3) \ + {print $1} else {print $3}}'` + make TESTCASES='python3 python3-trusted-args base-python3' \ + DISTRIBUTIONS='ubuntu18.04' \ + IMAGE_SUFFIX=-${COMMIT} GRAPHENE_BRANCH=${COMMIT} + ''' + } } - post { - success { - echo 'Deployment successful' - } - failure { - echo 'Failure while on the pipeline' - } - unstable { - echo 'Pipeline marked as "unstable"' - } - always { - sh ''' - cd Tools/gsc/test - # Jenkins may automatically merge master into submitted commit (but - # maybe not): choose the original submitted commit for GSC (third - # commit in below git-log output if merged or first commit if not merged) - export COMMIT=`git log --pretty="%H %P" -n 1 | awk '{if(!$3) \ - {print $1} else {print $3}}'` - make clean TESTCASES='python3 python3-trusted-args base-python3' \ - DISTRIBUTIONS='ubuntu18.04' IMAGE_SUFFIX=-${COMMIT} - docker image prune -f - ''' - } + stage('Test') { + steps { + sh ''' + cd Tools/gsc/test + # Jenkins may automatically merge master into submitted commit (but + # maybe not): choose the original submitted commit for GSC (third + # commit in below git-log output if merged or first commit if not merged) + export COMMIT=`git log --pretty="%H %P" -n 1 | awk '{if(!$3) \ + {print $1} else {print $3}}'` + # Test Linux Pal + make test ENV_VARS='GSC_PAL=Linux' MAXTESTNUM=2 TESTCASES=python3 \ + DISTRIBUTIONS='ubuntu18.04' IMAGE_SUFFIX=-${COMMIT} + # Test Linux-SGX PAL + make test MAXTESTNUM=3 TESTCASES='python3 python3-trusted-args' \ + DISTRIBUTIONS='ubuntu18.04' IMAGE_SUFFIX=-${COMMIT} + # Test use of base Graphene Image + make test MAXTESTNUM=2 TESTCASES='python3' \ + DISTRIBUTIONS='ubuntu18.04-base' IMAGE_SUFFIX=-${COMMIT} + ''' + } } + } + post { + always { + sh ''' + cd Tools/gsc/test + # Jenkins may automatically merge master into submitted commit (but + # maybe not): choose the original submitted commit for GSC (third + # commit in below git-log output if merged or first commit if not merged) + export COMMIT=`git log --pretty="%H %P" -n 1 | awk '{if(!$3) \ + {print $1} else {print $3}}'` + make clean TESTCASES='python3 python3-trusted-args base-python3' \ + DISTRIBUTIONS='ubuntu18.04' IMAGE_SUFFIX=-${COMMIT} + docker image prune -f + ''' + } + } }