oto/assets/pipeline-test.yaml

175 lines
No EOL
3.6 KiB
YAML

---
property:
workspace: .
revision: 24c9423
valueTest: 15.3
pipeline:
id: main
workflow:
# - async: git
- exe: set-value
- exe: print
# - exe: buildDart
# - exe: json-reader
#동기식 실행, 해당 수행이 끝나야만 다음 스텝실행, command일경우 해당 id 기입
# - exe: appData
#비동기식 실행, 해당 수행이 완료됨과 관계없이 실행하고 다음 스텝을 실행한다
# - exe: buildDart
# - switch:
# condition-string: <!property.old-version>
# cases:
# #case 아이템 하나에 여러 작업을 array형태로 할당
# - value: 0.0.153
# tasks:
# - exe: git
# - async: git-count
# - wait-until-seconds: 10
# - wait-until-string: <!state.git-count> != complete
# - async: git-rev
# - while:
# condition-string: <!property.git-rev> == null
# on-do:
# - exe: git
# - switch:
# condition-string: <!property.git-rev>
# cases:
# #case 아이템 하나에 여러 작업을 array형태로 할당
# - value: b6c2d44b2ec8b1a22fd9a88f4779e250b6ddc6b1
# tasks:
# - exe: git
#일반적인 if문과 동일
# - if:
# #property의 내용은 기본 dynamic(Object)형으로써, 비교시 정확한 캐스팅 필요, 적지 않을시 기본 string
# condition-string: <!property.git-rev> != <!property.old-git-rev>
# on-true:
# - exe: zip
commands:
### 파이프라인 실행도중 값 세팅
- command: SetValue
id: set-value
param:
values-string:
stringTest: Test!
values-int:
intTest: 12
values-float:
floatTest: <!property.valueTest>
values-bool:
boolTest: true
### Print
- command: Print
id: print
param:
message: this is test message / <!property.stringTest> / <!property.intTest> / <!property.floatTest> / <!property.boolTest>
### 콜백이 필요없는 단순 Git 명령 호출
- command: Git
id: git
param:
commands:
- restore .
- clean -f
- checkout c65a8bb
### Git 최신 리비전으로 업데이트
- command: Git
id: git-update
param:
commands:
- fetch origin
- reset --hard origin/master
### Git 로컬로 체크아웃
- command: GitCheckout
id: git-checkout
param:
branch: main
execute-pull: true
### Git Push
- command: GitPush
id: git-push
param:
branch: main
### 깃 리비전 정보 저장
- command: GitRev
id: git-rev
param:
result-value: <!property.git-rev>
### 깃 커밋카운트 저장
- command: GitCount
id: git-count
param:
result-value: <!property.git-count>
### Json value read
- command: JsonReader
id: json-reader
param:
json: <!property.payload>
pair:
- from: deleted
setValue: <@property.deleted>
### Version 쓰기
- command: CreateAppData
id: appData
param:
scm: Git
name: OTO
relativeAssetPath: assets/data
return-version: "<!property.version>"
return-hash: "<!property.hash>"
### 실행가능한 파일로 빌드
- command: BuildDart
id: buildDart
param: {}
### 최종 zip 파일 형태로 저장
- command: Zip
id: zip
param:
zipFile: "<!property.workspace>/release/oto_win_v<!property.version>.zip"
zipList:
- "<!property.workspace>/release/oto_cli.exe"
- command: AwsCli
id: aws-cli
param:
sub-command: s3api get-object
args:
- --profile vo-stage
- --bucket vo-stage-deploy
- --key stage/webserver/revision/api.jar
- api-0.0.1.jar
- command: Docker
id: docker
param:
sub-command: stop
args:
- web
- command: Gradle
id: gradle
param:
args:
- -p backend
- clean
- build