-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile
78 lines (71 loc) · 2.42 KB
/
Jenkinsfile
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
pipeline {
agent { label 'ubuntu-2404' }
options {
skipStagesAfterUnstable()
// TODO: Add more lenient rules for dev
buildDiscarder(logRotator(artifactDaysToKeepStr: "7", artifactNumToKeepStr: "2"))
}
tools { go '1.22.2' }
stages {
stage('Checkout code') {
steps {
checkout scm
}
}
stage('Build sfstests') {
steps {
sh '''
git clone "https://github.com/leil-io/sfstests"
cd sfstests
git checkout v0.3.0
go build -o $WORKSPACE/sfstests
'''
}
}
stage('Build image') {
steps {
sh '''
cd $WORKSPACE
mkdir build
docker buildx build --build-arg BASE_IMAGE=ubuntu:24.04 --tag saunafs-test:latest -f sfstests/Dockerfile.ci $WORKSPACE
docker save saunafs-test:latest -o ./build/sfstests.tar
'''
archiveArtifacts artifacts: 'build/*.tar', fingerprint: true
}
}
stage('Run Sanity') {
steps {
sh ''' ./sfstests/sfstests --auth /etc/apt/auth.conf.d/ --workers 28 --cpus 1'''
}
}
stage('Run short system tests') {
steps {
sh ''' ./sfstests/sfstests --auth /etc/apt/auth.conf.d/ --suite ShortSystemTests --workers 16 --multiplier 2 --cpus 2'''
}
}
stage('Run machine tests') {
steps {
sh ''' ./sfstests/sfstests --auth /etc/apt/auth.conf.d/ --suite SingleMachineTests --workers 1 --multiplier 2'''
}
}
stage('Run long system tests') {
steps {
sh ''' ./sfstests/sfstests --auth /etc/apt/auth.conf.d/ --suite LongSystemTests --workers 12 --multiplier 2 --cpus 2'''
}
}
}
post {
// Clean after build
always {
cleanWs(cleanWhenNotBuilt: true,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
)
sh '''
docker rm $(docker stop $(docker ps -a -q --filter ancestor=saunafs-test --format="{{.ID}}")) || true
docker image rm saunafs-test || true
'''
}
}
}