You've already forked jenkins-lib
forked from jenkins/jenkins-lib
Причесывание едт-шага
This commit is contained in:
@@ -29,4 +29,6 @@ interface IStepExecutor {
|
||||
void createDir(String path)
|
||||
|
||||
def withEnv(List<String> strings, Closure body)
|
||||
|
||||
def archiveArtifacts(String path)
|
||||
}
|
@@ -73,4 +73,9 @@ class StepExecutor implements IStepExecutor {
|
||||
body()
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
def archiveArtifacts(String path) {
|
||||
steps.archiveArtifacts path
|
||||
}
|
||||
}
|
||||
|
@@ -27,30 +27,32 @@ class EdtValidate implements Serializable {
|
||||
|
||||
def env = steps.env();
|
||||
|
||||
def projectDir = "$env.WORKSPACE/build/project"
|
||||
def resultFileRelative = 'build/out/edt-validate.xml'
|
||||
def projectName = 'temp'
|
||||
def workspaceDir = "$env.WORKSPACE/build/workspace"
|
||||
def resultFile = "$env.WORKSPACE/build/edt-validate.xml"
|
||||
def resultFile = "$env.WORKSPACE/$resultFileRelative"
|
||||
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.withEnv(['RING_OPTS="-Dfile.encoding=UTF-8 -Dosgi.nl=ru -Duser.language=ru"']) {
|
||||
def ringCommand = "ring edt workspace import --configuration-files '$configurationRoot' --project-name $projectName --workspace-location '$workspaceDir'"
|
||||
|
||||
def ringOpts = ['_JAVA_OPTS="-Dfile.encoding=UTF-8 -Dosgi.nl=ru -Duser.language=ru"']
|
||||
steps.withEnv(ringOpts) {
|
||||
steps.cmd(ringCommand)
|
||||
}
|
||||
|
||||
Logger.println("Выполнение валидации EDT")
|
||||
|
||||
ringCommand = "ring edt workspace validate --workspace-location '$workspaceDir' --file '$resultFile' --project '$projectDir'"
|
||||
ringCommand = "ring edt workspace validate --workspace-location '$workspaceDir' --file '$resultFile' --project-name-list $projectName"
|
||||
|
||||
steps.withEnv(['RING_OPTS="-Dfile.encoding=UTF-8 -Dosgi.nl=ru -Duser.language=ru"']) {
|
||||
steps.withEnv(ringOpts) {
|
||||
steps.cmd(ringCommand)
|
||||
}
|
||||
|
||||
steps.archiveArtifacts(resultFileRelative)
|
||||
}
|
||||
}
|
||||
|
@@ -10,4 +10,10 @@ class Logger implements Serializable {
|
||||
def env = steps.env();
|
||||
steps.echo("Running on node $env.NODE_NAME")
|
||||
}
|
||||
|
||||
static void println(String message) {
|
||||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor()
|
||||
|
||||
steps.echo(message)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user