-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
507 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/ru/pulsar/jenkins/library/configuration/ResultsTransformOptions.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ru.pulsar.jenkins.library.configuration | ||
|
||
import com.cloudbees.groovy.cps.NonCPS | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties | ||
import com.fasterxml.jackson.annotation.JsonPropertyDescription | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
class ResultsTransformOptions implements Serializable { | ||
|
||
@JsonPropertyDescription("Фильтровать замечания по уровню поддержки модуля") | ||
boolean removeSupport | ||
|
||
@JsonPropertyDescription("""Настройка фильтрации замечаний по уровню поддержки. | ||
0 - удалить файлы на замке; | ||
1 - удалить файлы на замке и на поддержке; | ||
2 - удалить файлы на замке, на поддержке и снятые с поддержки. | ||
""") | ||
int supportLevel | ||
|
||
@Override | ||
@NonCPS | ||
String toString() { | ||
return "ResultsTransformOptions{" + | ||
"removeSupport=" + removeSupport + | ||
", supportLevel=" + supportLevel + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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 EdtTransform implements Serializable { | ||
|
||
public static final String PROJECT_NAME = 'temp' | ||
public static final String WORKSPACE = 'build/edt-workspace' | ||
public static final String WORKSPACE_ZIP = 'build/edt-workspace.zip' | ||
public static final String WORKSPACE_ZIP_STASH = 'edt-workspace-zip' | ||
|
||
private final JobConfiguration config; | ||
|
||
EdtTransform(JobConfiguration config) { | ||
this.config = config | ||
} | ||
|
||
def run() { | ||
IStepExecutor steps = ContextRegistry.getContext().getStepExecutor() | ||
|
||
Logger.printLocation() | ||
|
||
if (!config.stageFlags.edtValidate) { | ||
Logger.println("EDT validate step is disabled. No transform is needed.") | ||
return | ||
} | ||
|
||
def env = steps.env(); | ||
|
||
def workspaceDir = "$env.WORKSPACE/$WORKSPACE" | ||
def configurationRoot = new File(env.WORKSPACE, config.srcDir).getAbsolutePath() | ||
|
||
steps.createDir(workspaceDir) | ||
|
||
Logger.println("Конвертация исходников из формата конфигуратора в формат EDT") | ||
|
||
def ringCommand = "ring edt workspace import --configuration-files '$configurationRoot' --project-name $PROJECT_NAME --workspace-location '$workspaceDir'" | ||
|
||
def ringOpts = ['RING_OPTS=-Dfile.encoding=UTF-8 -Dosgi.nl=ru -Duser.language=ru'] | ||
steps.withEnv(ringOpts) { | ||
steps.cmd(ringCommand) | ||
} | ||
|
||
steps.zip(WORKSPACE, WORKSPACE_ZIP) | ||
steps.stash(WORKSPACE_ZIP_STASH, WORKSPACE_ZIP) | ||
} | ||
} |
Oops, something went wrong.