You've already forked jenkins-lib
mirror of
https://github.com/firstBitMarksistskaya/jenkins-lib.git
synced 2025-08-25 20:09:25 +02:00
Скромные попытки завести EDT
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
},
|
||||
"stages": {
|
||||
"sonarqube": false,
|
||||
"syntaxCheck": false
|
||||
"syntaxCheck": false,
|
||||
"edtValidate": false
|
||||
},
|
||||
"sonarqube": {
|
||||
"sonarQubeInstallation": "",
|
||||
|
@@ -33,6 +33,10 @@
|
||||
"syntaxCheck" : {
|
||||
"type" : "boolean",
|
||||
"description" : "Синтаксический контроль включен"
|
||||
},
|
||||
"edtValidate" : {
|
||||
"type" : "boolean",
|
||||
"description" : "Валидация EDT включена"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -25,4 +25,6 @@ interface IStepExecutor {
|
||||
void withSonarQubeEnv(String installationName, Closure body)
|
||||
|
||||
EnvironmentAction env()
|
||||
|
||||
void createDir(String path)
|
||||
}
|
@@ -61,4 +61,9 @@ class StepExecutor implements IStepExecutor {
|
||||
EnvironmentAction env() {
|
||||
return steps.env
|
||||
}
|
||||
|
||||
@Override
|
||||
void createDir(String path) {
|
||||
steps.createDir(path)
|
||||
}
|
||||
}
|
||||
|
@@ -12,12 +12,16 @@ class StageFlags implements Serializable {
|
||||
@JsonPropertyDescription("Синтаксический контроль включен")
|
||||
boolean syntaxCheck
|
||||
|
||||
@JsonPropertyDescription("Валидация EDT включена")
|
||||
boolean edtValidate
|
||||
|
||||
@Override
|
||||
@NonCPS
|
||||
String toString() {
|
||||
return "StageFlags{" +
|
||||
"sonarQube=" + sonarqube +
|
||||
"sonarqube=" + sonarqube +
|
||||
", syntaxCheck=" + syntaxCheck +
|
||||
", edtValidate=" + edtValidate +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
51
src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy
Normal file
51
src/ru/pulsar/jenkins/library/steps/EdtValidate.groovy
Normal file
@@ -0,0 +1,51 @@
|
||||
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 EdtValidate implements Serializable {
|
||||
|
||||
private final JobConfiguration config;
|
||||
private final String rootDir
|
||||
|
||||
EdtValidate(JobConfiguration config, String rootDir = 'src/cf') {
|
||||
this.config = config
|
||||
this.rootDir = rootDir
|
||||
}
|
||||
|
||||
def run() {
|
||||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
||||
|
||||
Logger.printLocation()
|
||||
|
||||
if (!config.stageFlags.edtValidate) {
|
||||
steps.echo("EDT validate step is disabled")
|
||||
return
|
||||
}
|
||||
|
||||
def env = steps.env();
|
||||
|
||||
def projectDir = "$env.WORKSPACE/build/project"
|
||||
def workspaceDir = "$env.WORKSPACE/build/workspace"
|
||||
def resultFile = "$env.WORKSPACE/build/edt-validate.xml"
|
||||
def configurationRoot = new File(env.WORKSPACE, rootDir).getAbsolutePath()
|
||||
|
||||
steps.createDir(projectDir)
|
||||
steps.createDir(workspaceDir)
|
||||
steps.createDir(new File(resultFile).getParent())
|
||||
|
||||
|
||||
Logger.println("Конвертация исходников из формата конфигуратора в формат EDT")
|
||||
|
||||
def ringCommand = "ring edt workspace import --configuration-files '$configurationRoot' --project '$projectDir' --workspace-location '$workspaceDir'"
|
||||
steps.cmd(ringCommand)
|
||||
|
||||
Logger.println("Выполнение валидации EDT")
|
||||
|
||||
env.RING_OPTS = '-Dfile.encoding=UTF-8 -Dosgi.nl=ru'
|
||||
ringCommand = "ring edt workspace validate --workspace-location '$workspaceDir' --file '$resultFile' --project '$projectDir'"
|
||||
steps.cmd(ringCommand)
|
||||
}
|
||||
}
|
3
vars/createDir.groovy
Normal file
3
vars/createDir.groovy
Normal file
@@ -0,0 +1,3 @@
|
||||
def call(String path) {
|
||||
dir(path) { echo '' }
|
||||
}
|
10
vars/edtValidate.groovy
Normal file
10
vars/edtValidate.groovy
Normal file
@@ -0,0 +1,10 @@
|
||||
import ru.pulsar.jenkins.library.configuration.JobConfiguration
|
||||
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||
import ru.pulsar.jenkins.library.steps.EdtValidate
|
||||
|
||||
def call(JobConfiguration config, String rootDir = 'src/cf') {
|
||||
ContextRegistry.registerDefaultContext(this)
|
||||
|
||||
def edtValidate = new EdtValidate(config, rootDir)
|
||||
edtValidate.run()
|
||||
}
|
@@ -67,6 +67,15 @@ void call() {
|
||||
|
||||
stage('Проверка качества') {
|
||||
parallel {
|
||||
stage('EDT контроль') {
|
||||
agent {
|
||||
label 'edt'
|
||||
}
|
||||
steps {
|
||||
edtValidate config
|
||||
}
|
||||
}
|
||||
|
||||
stage('Синтаксический контроль') {
|
||||
steps {
|
||||
syntaxCheck config
|
||||
|
@@ -21,7 +21,7 @@ def call(JobConfiguration config) {
|
||||
unzipInfobase()
|
||||
|
||||
def outPath = new File(options.pathToJUnitReport).getParent()
|
||||
dir(outPath) { echo '' }
|
||||
createDir(outPath)
|
||||
|
||||
String command = "oscript_modules/bin/vrunner syntax-check --ibconnection \"/F./build/ib\""
|
||||
|
||||
|
Reference in New Issue
Block a user