You've already forked jenkins-lib
forked from jenkins/jenkins-lib
Параметр srcDir в конфиг
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "schema.json",
|
"$schema": "schema.json",
|
||||||
|
"srcDir": "src/cf",
|
||||||
"secrets": {
|
"secrets": {
|
||||||
"storagePath": "UNKNOWN_ID",
|
"storagePath": "UNKNOWN_ID",
|
||||||
"storage": "UNKNOWN_ID"
|
"storage": "UNKNOWN_ID"
|
||||||
|
@@ -6,6 +6,10 @@
|
|||||||
"type" : "string",
|
"type" : "string",
|
||||||
"description" : "Версия платформы 1С:Предприятие в формате 8.3.хх.хххх."
|
"description" : "Версия платформы 1С:Предприятие в формате 8.3.хх.хххх."
|
||||||
},
|
},
|
||||||
|
"srcDir" : {
|
||||||
|
"type" : "string",
|
||||||
|
"description" : "Путь к корневому каталогу с исходниками конфигурации"
|
||||||
|
},
|
||||||
"secrets" : {
|
"secrets" : {
|
||||||
"type" : "object",
|
"type" : "object",
|
||||||
"id" : "urn:jsonschema:ru:pulsar:jenkins:library:configuration:Secrets",
|
"id" : "urn:jsonschema:ru:pulsar:jenkins:library:configuration:Secrets",
|
||||||
|
@@ -10,6 +10,9 @@ class JobConfiguration implements Serializable {
|
|||||||
@JsonPropertyDescription("Версия платформы 1С:Предприятие в формате 8.3.хх.хххх.")
|
@JsonPropertyDescription("Версия платформы 1С:Предприятие в формате 8.3.хх.хххх.")
|
||||||
String v8version
|
String v8version
|
||||||
|
|
||||||
|
@JsonPropertyDescription("Путь к корневому каталогу с исходниками конфигурации")
|
||||||
|
String srcDir
|
||||||
|
|
||||||
@JsonProperty("stages")
|
@JsonProperty("stages")
|
||||||
@JsonPropertyDescription("Включение этапов сборок")
|
@JsonPropertyDescription("Включение этапов сборок")
|
||||||
StageFlags stageFlags;
|
StageFlags stageFlags;
|
||||||
@@ -34,6 +37,7 @@ class JobConfiguration implements Serializable {
|
|||||||
String toString() {
|
String toString() {
|
||||||
return "JobConfiguration{" +
|
return "JobConfiguration{" +
|
||||||
"v8version='" + v8version + '\'' +
|
"v8version='" + v8version + '\'' +
|
||||||
|
", srcDir='" + srcDir + '\'' +
|
||||||
", stageFlags=" + stageFlags +
|
", stageFlags=" + stageFlags +
|
||||||
", secrets=" + secrets +
|
", secrets=" + secrets +
|
||||||
", sonarQubeOptions=" + sonarQubeOptions +
|
", sonarQubeOptions=" + sonarQubeOptions +
|
||||||
|
@@ -13,11 +13,9 @@ class EdtTransform implements Serializable {
|
|||||||
public static final String WORKSPACE_ZIP_STASH = 'edt-workspace-zip'
|
public static final String WORKSPACE_ZIP_STASH = 'edt-workspace-zip'
|
||||||
|
|
||||||
private final JobConfiguration config;
|
private final JobConfiguration config;
|
||||||
private final String rootDir
|
|
||||||
|
|
||||||
EdtTransform(JobConfiguration config, String rootDir = 'src/cf') {
|
EdtTransform(JobConfiguration config) {
|
||||||
this.config = config
|
this.config = config
|
||||||
this.rootDir = rootDir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def run() {
|
def run() {
|
||||||
@@ -33,7 +31,7 @@ class EdtTransform implements Serializable {
|
|||||||
def env = steps.env();
|
def env = steps.env();
|
||||||
|
|
||||||
def workspaceDir = "$env.WORKSPACE/$WORKSPACE"
|
def workspaceDir = "$env.WORKSPACE/$WORKSPACE"
|
||||||
def configurationRoot = new File(env.WORKSPACE, rootDir).getAbsolutePath()
|
def configurationRoot = new File(env.WORKSPACE, config.srcDir).getAbsolutePath()
|
||||||
|
|
||||||
steps.createDir(workspaceDir)
|
steps.createDir(workspaceDir)
|
||||||
|
|
||||||
|
@@ -11,11 +11,9 @@ class EdtValidate implements Serializable {
|
|||||||
public static final String RESULT_FILE = 'build/out/edt-validate.out'
|
public static final String RESULT_FILE = 'build/out/edt-validate.out'
|
||||||
|
|
||||||
private final JobConfiguration config;
|
private final JobConfiguration config;
|
||||||
private final String rootDir
|
|
||||||
|
|
||||||
EdtValidate(JobConfiguration config, String rootDir = 'src/cf') {
|
EdtValidate(JobConfiguration config) {
|
||||||
this.config = config
|
this.config = config
|
||||||
this.rootDir = rootDir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def run() {
|
def run() {
|
||||||
|
@@ -21,11 +21,6 @@ class ResultsTransformer implements Serializable {
|
|||||||
|
|
||||||
Logger.printLocation()
|
Logger.printLocation()
|
||||||
|
|
||||||
if (!config.stageFlags.sonarqube) {
|
|
||||||
Logger.println("No transform is needed.")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
def env = steps.env();
|
def env = steps.env();
|
||||||
|
|
||||||
if (!config.stageFlags.edtValidate) {
|
if (!config.stageFlags.edtValidate) {
|
||||||
@@ -33,22 +28,18 @@ class ResultsTransformer implements Serializable {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
steps.unstash(EdtTransform.WORKSPACE_ZIP_STASH)
|
|
||||||
steps.unzip(EdtTransform.WORKSPACE, EdtTransform.WORKSPACE_ZIP)
|
|
||||||
|
|
||||||
steps.unstash(EdtValidate.RESULT_STASH)
|
steps.unstash(EdtValidate.RESULT_STASH)
|
||||||
|
|
||||||
Logger.println("Конвертация результата EDT в Generic Issue")
|
Logger.println("Конвертация результата EDT в Generic Issue")
|
||||||
|
|
||||||
def edtValidateFile = "$env.WORKSPACE/$EdtValidate.RESULT_FILE"
|
def edtValidateFile = "$env.WORKSPACE/$EdtValidate.RESULT_FILE"
|
||||||
def genericIssueFile = "$env.WORKSPACE/$RESULT_FILE"
|
def genericIssueFile = "$env.WORKSPACE/$RESULT_FILE"
|
||||||
def srcDir = "src/cf"
|
|
||||||
|
|
||||||
steps.cmd("stebi convert $edtValidateFile $genericIssueFile $srcDir")
|
steps.cmd("stebi convert $edtValidateFile $genericIssueFile $config.srcDir")
|
||||||
|
|
||||||
if (config.resultsTransformOptions.removeSupport) {
|
if (config.resultsTransformOptions.removeSupport) {
|
||||||
def supportLevel = config.resultsTransformOptions.supportLevel
|
def supportLevel = config.resultsTransformOptions.supportLevel
|
||||||
steps.cmd("stebi transform --remove_support $supportLevel --src $srcDir $genericIssueFile")
|
steps.cmd("stebi transform --remove_support $supportLevel --src $config.srcDir $genericIssueFile")
|
||||||
}
|
}
|
||||||
|
|
||||||
steps.archiveArtifacts(RESULT_FILE)
|
steps.archiveArtifacts(RESULT_FILE)
|
||||||
|
@@ -11,9 +11,9 @@ class SonarScanner implements Serializable {
|
|||||||
private final JobConfiguration config;
|
private final JobConfiguration config;
|
||||||
private final String rootFile
|
private final String rootFile
|
||||||
|
|
||||||
SonarScanner(JobConfiguration config, String rootFile = 'src/cf/Configuration.xml') {
|
SonarScanner(JobConfiguration config) {
|
||||||
this.config = config
|
this.config = config
|
||||||
this.rootFile = rootFile
|
this.rootFile = "$config.srcDir/Configuration.xml"
|
||||||
}
|
}
|
||||||
|
|
||||||
def run() {
|
def run() {
|
||||||
|
@@ -2,9 +2,9 @@ import ru.pulsar.jenkins.library.configuration.JobConfiguration
|
|||||||
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||||
import ru.pulsar.jenkins.library.steps.EdtTransform
|
import ru.pulsar.jenkins.library.steps.EdtTransform
|
||||||
|
|
||||||
def call(JobConfiguration config, String rootDir = 'src/cf') {
|
def call(JobConfiguration config) {
|
||||||
ContextRegistry.registerDefaultContext(this)
|
ContextRegistry.registerDefaultContext(this)
|
||||||
|
|
||||||
def edtTransform = new EdtTransform(config, rootDir)
|
def edtTransform = new EdtTransform(config)
|
||||||
edtTransform.run()
|
edtTransform.run()
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@ import ru.pulsar.jenkins.library.configuration.JobConfiguration
|
|||||||
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||||
import ru.pulsar.jenkins.library.steps.EdtValidate
|
import ru.pulsar.jenkins.library.steps.EdtValidate
|
||||||
|
|
||||||
def call(JobConfiguration config, String rootDir = 'src/cf') {
|
def call(JobConfiguration config) {
|
||||||
ContextRegistry.registerDefaultContext(this)
|
ContextRegistry.registerDefaultContext(this)
|
||||||
|
|
||||||
def edtValidate = new EdtValidate(config, rootDir)
|
def edtValidate = new EdtValidate(config)
|
||||||
edtValidate.run()
|
edtValidate.run()
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@ import ru.pulsar.jenkins.library.configuration.JobConfiguration
|
|||||||
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
import ru.pulsar.jenkins.library.ioc.ContextRegistry
|
||||||
import ru.pulsar.jenkins.library.steps.SonarScanner
|
import ru.pulsar.jenkins.library.steps.SonarScanner
|
||||||
|
|
||||||
def call(JobConfiguration config, String rootFile = 'src/cf/Configuration.xml') {
|
def call(JobConfiguration config) {
|
||||||
ContextRegistry.registerDefaultContext(this)
|
ContextRegistry.registerDefaultContext(this)
|
||||||
|
|
||||||
def sonarScanner = new SonarScanner(config, rootFile)
|
def sonarScanner = new SonarScanner(config)
|
||||||
sonarScanner.run()
|
sonarScanner.run()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user