-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
52 lines (49 loc) · 1.2 KB
/
Jenkinsfile
File metadata and controls
52 lines (49 loc) · 1.2 KB
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
pipeline {
agent {
label 'ui-agent'
}
environment {
DISPLAY = ':99'
VIDEO_FILE_NAME = 'test.mp4'
}
tools {
maven 'mvn3.8.3'
jdk 'jdk11'
}
stages {
stage('Tests') {
steps {
usexvfb()
downloadChromeDriver()
sh 'mvn clean test'
}
post {
always {
cleanUp()
archiveArtifacts artifacts: VIDEO_FILE_NAME, followSymlinks: false
}
}
}
}
}
def usexvfb(){
sh """
sudo apt-get update && sudo apt-get install ffmpeg -y
Xvfb :99 -ac -screen 0 1280x1024x24 &
ffmpeg -f x11grab -i :99 -c:v libx264 -preset ultrafast -tune zerolatency -crf 25 ./${VIDEO_FILE_NAME} &
"""
}
def downloadChromeDriver(){
sh """
#Download the ChromeDriver package
wget -O /tmp/chrome-linux64.zip https://storage.googleapis.com/chrome-for-testing-public/121.0.6167.184/linux64/chromedriver-linux64.zip
unzip /tmp/chrome-linux64.zip
chmod +x chromedriver-linux64/chromedriver
"""
}
def cleanUp(){
sh """
killall Xvfb
killall ffmpeg
"""
}