You've already forked jenkins-lib
mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2025-08-25 20:09:25 +02:00
yaxunit coverage cleanup
This commit is contained in:
31
src/ru/pulsar/jenkins/library/steps/CoverageCleanup.groovy
Normal file
31
src/ru/pulsar/jenkins/library/steps/CoverageCleanup.groovy
Normal file
@@ -0,0 +1,31 @@
|
||||
package ru.pulsar.jenkins.library.steps
|
||||
|
||||
import ru.pulsar.jenkins.library.IStepExecutor
|
||||
import ru.pulsar.jenkins.library.configuration.JobConfiguration
|
||||
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||
import ru.pulsar.jenkins.library.utils.Logger
|
||||
|
||||
class CoverageCleanup implements Serializable {
|
||||
|
||||
private final JobConfiguration config;
|
||||
|
||||
private String encoding = 'UTF-8'
|
||||
|
||||
CoverageCleanup(JobConfiguration config) {
|
||||
this.config = config
|
||||
}
|
||||
|
||||
def run() {
|
||||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
||||
|
||||
Logger.printLocation()
|
||||
|
||||
if (steps.isUnix()) {
|
||||
def command = "pkill Coverage41C && pkill dbgs"
|
||||
steps.sh(command, false, false, encoding)
|
||||
} else {
|
||||
def command = "taskkill /IM Coverage41C /F & taskkill /IM dbgs /F"
|
||||
steps.sh(command, false, false, encoding)
|
||||
}
|
||||
}
|
||||
}
|
11
vars/coverageCleanup.groovy
Normal file
11
vars/coverageCleanup.groovy
Normal file
@@ -0,0 +1,11 @@
|
||||
import ru.pulsar.jenkins.library.configuration.JobConfiguration
|
||||
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||
import ru.pulsar.jenkins.library.steps.CoverageCleanup
|
||||
|
||||
def call(JobConfiguration config) {
|
||||
ContextRegistry.registerDefaultContext(this)
|
||||
|
||||
def coverageCleanup = new CoverageCleanup(config);
|
||||
coverageCleanup.run()
|
||||
|
||||
}
|
@@ -325,6 +325,11 @@ void call() {
|
||||
yaxunit config
|
||||
}
|
||||
}
|
||||
post('yaxunit-coverage-cleanup') {
|
||||
always {
|
||||
coverageCleanup config
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user