This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 261
/
Copy pathLinux-SGX-gsc
80 lines (80 loc) · 3.88 KB
/
Linux-SGX-gsc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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' \
DISTRIBUTIONS="ubuntu18.04" \
IMAGE_SUFFIX=-${COMMIT} GRAPHENE_BRANCH=${COMMIT}
'''
}
}
stage('Test_CD') {
steps {
sh '''
cd Tools/gsc
make build-images
make distclean
'''
}
}
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" IMAGE_SUFFIX=-base-${COMMIT}
'''
}
}
stage('Deploy') {
steps {
sh 'echo Deploying code'
}
}
}
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' \
DISTRIBUTIONS="ubuntu18.04" IMAGE_SUFFIX=-${COMMIT}
docker image prune -f
'''
}
}
}