-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
63 lines (54 loc) · 1.98 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
pipeline {
agent {
label "php"
}
stages {
stage('Build') {
steps {
echo "[STAGE] Build"
sh "if [ -d build ]; then rm -rf build ; fi && mkdir -p build/logs"
}
}
stage('Test') {
steps {
echo "[STAGE] Test"
sh (
returnStatus: true,
script: "phpcs --report=checkstyle --report-file=./build/logs/checkstyle.xml --standard=PSR2 --extensions=php ./"
)
sh (
returnStatus: true,
script: "phpmd ./ xml codesize,cleancode,design,naming,unusedcode,controversial --reportfile build/logs/pmd.xml"
)
// sh '''vendor/bin/phpunit --log-junit=build/junit.xml \
// --coverage-html=build/coverage \
// --coverage-clover=build/clover.xml'''
// junit 'build/junit.xml'
}
}
stage('Report') {
steps {
echo "[STAGE] Report"
// checkstyle canComputeNew: false, defaultEncoding: '', healthy: '', pattern: 'build/logs/checkstyle.xml', unHealthy: ''
// pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: 'build/logs/pmd.xml', unHealthy: ''
// junit 'build/junit.xml'
}
}
stage('Sonarqube') {
agent { label "master" }
steps {
script {
def scannerHome = tool name: 'SonarQube Scanner 3.0.1', type: 'hudson.plugins.sonar.SonarRunnerInstallation';
withSonarQubeEnv() {
sh "$scannerHome/bin/sonar-scanner -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_AUTH_TOKEN"
}
}
}
}
stage('Deploy') {
steps {
echo "[STAGE] Deploy"
}
}
}
}