contain pipeline에 string형 수정

This commit is contained in:
leedongmyung(desktop) 2025-03-31 15:31:33 +09:00
parent 102ee4f238
commit 94efbd63dd
4 changed files with 23 additions and 11 deletions

View file

@ -25,7 +25,7 @@ pipeline:
#property의 내용은 기본 dynamic(Object)형으로써, 비교시 정확한 캐스팅 필요, 적지 않을시 기본 string
condition: <property:test> == <property:result> [int]
#false도 가능, true/false로 선언시 일반적인 else와 동일
true:
on-true:
- exe: <command:buildDartCompile#1>
#일반적인 while문과 동일
@ -39,7 +39,7 @@ pipeline:
- if:
#version에 대한 비교시, 자릿수는 같아야 한다 0.0.0 or 0.0.0.0
condition: <property:version> == 1.0.1 [version]
true:
on-true:
#조건문 내에도 선언 가능, 반대도 가능
- while:
condition-int: <property:result> < 10

View file

@ -7,6 +7,11 @@ property:
pipeline:
id: main
workflow:
- contain:
list: this is test
target: back
on-true:
- exe: print0
- exe: read-web
- exe: json-read-web
- exe: json-read-local
@ -28,6 +33,11 @@ pipeline:
commands:
- command: Print
id: print0
param:
message: test
- command: FileInfo
id: info
param:

View file

@ -65,7 +65,6 @@ echo -e '
}'
''';
var result = await ProcessExecutor.run(StringBuffer(script));
print('===================>\n${result.stdout}');
jenkinsMap = getMapFromJson(result.stdout)!;
//write build data

View file

@ -39,18 +39,21 @@ class PipelineContain extends PipelineExecutor {
@override
Future execute() async {
List list;
var listRaw = data.list;
if(listRaw is String) {
list = Command.replaceSingleTagValue(listRaw);
} else {
list = listRaw as List;
}
var result = ConditionCheckResult();
var value = Command.replaceSingleTagValue(data.target);
value ??= data.target;
result.conditionValue = 'Contain in "$value".';
result.result = list.contains(value);
var listRaw = data.list;
if(listRaw is String) {
var str = Command.replaceTagValue(listRaw) as String;
result.result = str.contains(value);
} else {
var list = listRaw as List;
result.result = list.contains(value);
}
await PipelineExecutor.printCondition('Contain', 'Contain in "${data.target}"', getPostfix(result.result), result);
if (result.result) {
await _pipelineTrue?.execute();