You've already forked jenkins-lib
forked from jenkins/jenkins-lib
Рефакторинг
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"$schema": "schema.json",
|
||||
"srcDir": "src/cf",
|
||||
"sourceFormat": "designer",
|
||||
"secrets": {
|
||||
"storagePath": "UNKNOWN_ID",
|
||||
"storage": "UNKNOWN_ID"
|
||||
},
|
||||
"stages": {
|
||||
"srcEDT" : true,
|
||||
"initSteps": false,
|
||||
"sonarqube": false,
|
||||
"bdd": false,
|
||||
|
@@ -10,6 +10,11 @@
|
||||
"type" : "string",
|
||||
"description" : "Путь к корневому каталогу с исходниками конфигурации"
|
||||
},
|
||||
"sourceFormat" : {
|
||||
"type" : "string",
|
||||
"description" : "Формат исходников конфигурации",
|
||||
"enum" : [ "edt", "designer" ]
|
||||
},
|
||||
"secrets" : {
|
||||
"type" : "object",
|
||||
"id" : "urn:jsonschema:ru:pulsar:jenkins:library:configuration:Secrets",
|
||||
@@ -53,10 +58,6 @@
|
||||
"bdd" : {
|
||||
"type" : "boolean",
|
||||
"description" : "Запуск BDD сценариев включен"
|
||||
},
|
||||
"srcEDT" : {
|
||||
"type" : "boolean",
|
||||
"description" : "Конвертировать исходники из формата EDT в формат конфигуратора"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -13,6 +13,9 @@ class JobConfiguration implements Serializable {
|
||||
@JsonPropertyDescription("Путь к корневому каталогу с исходниками конфигурации")
|
||||
String srcDir
|
||||
|
||||
@JsonPropertyDescription("Формат исходников конфигурации")
|
||||
SourceFormat sourceFormat;
|
||||
|
||||
@JsonProperty("stages")
|
||||
@JsonPropertyDescription("Включение этапов сборок")
|
||||
StageFlags stageFlags;
|
||||
@@ -50,6 +53,7 @@ class JobConfiguration implements Serializable {
|
||||
return "JobConfiguration{" +
|
||||
"v8version='" + v8version + '\'' +
|
||||
", srcDir='" + srcDir + '\'' +
|
||||
", sourceFormat='" + sourceFormat +
|
||||
", stageFlags=" + stageFlags +
|
||||
", secrets=" + secrets +
|
||||
", initInfobaseOptions=" + initInfobaseOptions +
|
||||
|
@@ -0,0 +1,17 @@
|
||||
package ru.pulsar.jenkins.library.configuration
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public enum SourceFormat{
|
||||
@JsonProperty("edt")
|
||||
EDT,
|
||||
|
||||
@JsonProperty("designer")
|
||||
DESIGNER
|
||||
|
||||
boolean infobaseFromFiles(){
|
||||
return EDT
|
||||
}
|
||||
}
|
@@ -24,9 +24,6 @@ class StageFlags implements Serializable {
|
||||
@JsonPropertyDescription("Запуск BDD сценариев включен")
|
||||
boolean bdd
|
||||
|
||||
@JsonPropertyDescription("Исходники в формате EDT")
|
||||
boolean srcEDT
|
||||
|
||||
@Override
|
||||
@NonCPS
|
||||
String toString() {
|
||||
@@ -37,15 +34,10 @@ class StageFlags implements Serializable {
|
||||
", smoke=" + smoke +
|
||||
", initSteps=" + initSteps +
|
||||
", bdd=" + bdd +
|
||||
", srcEDT=" + srcEDT +
|
||||
'}';
|
||||
}
|
||||
|
||||
boolean needInfobase() {
|
||||
return smoke || syntaxCheck || initSteps || bdd
|
||||
}
|
||||
|
||||
boolean infobaseFromFiles() {
|
||||
return srcEDT
|
||||
}
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ void call() {
|
||||
}
|
||||
when {
|
||||
beforeAgent true
|
||||
expression { config.stageFlags.srcEDT }
|
||||
expression { config.sourceFormat.infobaseFromFiles() }
|
||||
}
|
||||
steps {
|
||||
script{
|
||||
@@ -73,7 +73,7 @@ void call() {
|
||||
|
||||
createDir('build/out')
|
||||
|
||||
if (config.stageFlags.infobaseFromFiles()){
|
||||
if (config.sourceFormat.infobaseFromFiles()){
|
||||
// Создание базы загрузкой из файлов
|
||||
initFromFiles config
|
||||
}
|
||||
|
Reference in New Issue
Block a user