oto/assets/example.yaml

93 lines
2.9 KiB
YAML

---
import:
- <file:./User/name/work/pipeline.yaml> #외부 정의 파이프라인 로드
#전역 변수(<Map, dynamic>), runtime에서 할당, 수정 가능
properties:
#<property:workspace>로 접근
workspace: ${WORKSPACE}
#pipeline 사용시에는 커맨드는 무조건 command id로만 사용
pipeline:
id: main
workflow:
#동기식 실행, 해당 수행이 끝나야만 다음 스텝실행, command일경우 해당 id 기입
- exe: <command:createAppData#1>
#비동기식 실행, 해당 수행이 완료됨과 관계없이 실행하고 다음 스텝을 실행한다
- async: <command:dartCompile#1>
#외부에서 import한 문서에 선언한 pipeline의 id
- exec: <pipeline:compareFile>
#일반적인 if문과 동일
- if:
#property의 내용은 기본 dynamic(Object)형으로써, 비교시 정확한 캐스팅 필요, 적지 않을시 기본 string
condition: <property:test> == <property:result> [int]
#false도 가능, true/false로 선언시 일반적인 else와 동일
on-true:
- exe: <command:buildDartCompile#1>
#일반적인 while문과 동일
- while:
condition-bool: <property:result>
do:
- async: <command:buildDart>
- exec: <command:zip#1>
#조건식이 끝날때까지 단순 대기, 비동기 실행의 완료를 잡기위함
- wait-until: <property:result> != null
- if:
#version에 대한 비교시, 자릿수는 같아야 한다 0.0.0 or 0.0.0.0
condition: <property:version> == 1.0.1 [version]
on-true:
#조건문 내에도 선언 가능, 반대도 가능
- while:
condition-int: <property:result> < 10
do:
- exec: <command:buildDart#1>
#일반적인 switch구문과 동일
- switch:
state: <property:test> [string]
case:
#case 아이템 하나에 여러 작업을 array형태로 할당
- <property:abb>:
- exec: <command:buildDartCompile#1>
- exec: <command:job#2>
- test:
- exec: <command:buildDart#1>
- default:
- exec: <command:build#1>
#pipeline에 기록된 command id가 command define list에 없다면 오류를 뱉으며 종료
commands:
- command: CreateAppData
id: createAppData#1
param:
scm: Git
relativeAssetPath: assets/data
#결과가 저장되는 command의 경우 선언
result:
#결과의 경우 무조건 설정하도록
version: <property:version>
#property[hash]에 저장
hash: <property:hash>
- command: BuildDart
id: buildDart#1
param: {}
- command: BuildDartCompile
id: buildDartCompile#1
param:
targetDartFile: ./bin/main.dart
buildFileName: oto_cli
- command: Zip
id: zip#1
param:
zipFile: <property:workspace>/release/oto_linux_v<!common.version>.zip
zipList:
- <property:workspace>/release/oto_cli
- <property:workspace>/release/test
rersult:
zipPath: <property:zipPath>