-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
73 lines (70 loc) · 2.71 KB
/
Jenkinsfile
File metadata and controls
73 lines (70 loc) · 2.71 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
pipeline {
// agent any
agent {
label "1c"
}
// environment {
// GLOBAL_VAR = "Test variable"
// }
stages {
stage('Vanessa tests') {
options {
// Set timeout for stage
// or you can set timeout for step like:
// timeout(time: 5, unit: 'MINUTES') { sh '<command>' }
timeout(time: 30, unit: 'MINUTES')
}
environment {
// Create credentials in Jenkins Global credentials store
REMOTE_INFOBASE_LOGIN = credentials('REMOTE_INFOBASE_LOGIN')
// Uncomment and create creds if it is not empty password
// REMOTE_INFOBASE_PASSWORD = credentials('REMOTE_INFOBASE_PASSWORD')
REMOTE_INFOBASE_PASSWORD = ""
REMOTE_INFOBASE_SRVR = credentials('REMOTE_INFOBASE_SRVR')
REMOTE_INFOBASE_REF = credentials('REMOTE_INFOBASE_REF')
// Combined envirmoents variables
REMOTE_INFOBASE_PATH = "Srvr=\"${REMOTE_INFOBASE_SRVR}\";Ref=\"${REMOTE_INFOBASE_REF}\";"
}
steps {
echo 'Vanessa Testing ...'
echo 'Prepare parans from template'
sh '''
envsubst < ./vanessa/VAParams.json.template > ./vanessa/VAParams.json
'''
echo 'Run vanessa-automation tests'
// Add to 1cv8c param if password exists: /P"${REMOTE_INFOBASE_PASSWORD}" \
sh '''
export DISPLAY=:1
echo "DISPLAY ID: ${DISPLAY}"
"/opt/1cv8/x86_64/8.3.26.1498/1cv8c"\
/N"${REMOTE_INFOBASE_LOGIN}" \
/TestManager \
/Execute "/usr/share/oscript/lib/vanessa-automation/vanessa-automation.epf" \
/IBConnectionString "${REMOTE_INFOBASE_PATH}" \
/C"StartFeaturePlayer;QuietInstallVanessaExt;VAParams=./vanessa/VAParams.json"
'''
echo '...done'
}
}
stage('SonarQube check') {
environment {
SONAR_TOKEN = credentials('SONAR_JENKINS_1C_TOKEN')
PATH = "${SONAR_SCANNER_HOME}/bin:${PATH}"
}
steps {
echo 'SonarQube Testing ...'
sh 'printenv PATH'
sh '''
sonar-scanner -Dsonar.projectKey=jenkins-1c -Dsonar.sources=. -Dsonar.host.url=http://host.docker.internal:9000
'''
echo '...done'
}
}
stage('Generate reports in Allure') {
steps {
echo 'Generate reports in Allure ...'
echo '...done'
}
}
}
}