oto/assets/yaml/sample/09_network.yaml

80 lines
1.9 KiB
YAML

---
# [샘플] 네트워크 / HTTP / FTP
property:
workspace: /path/to/project
pipeline:
id: main
workflow:
- exe: http-get # HTTP GET → 응답 저장
- exe: json-parse # 응답 JSON 파싱
- exe: http-post # HTTP POST
- exe: ftp-upload # FTP 업로드
- exe: ftp-download # FTP 다운로드
- exe: download-file # HTTP 파일 다운로드
commands:
# HTTP GET, 응답 body 저장
- command: WebRequest
id: http-get
param:
url: https://api.example.com/status
method: GET
headers:
Authorization: Bearer your-token
setResponse: <@property.apiResponse>
# 응답 JSON에서 값 추출
- command: JsonReader
id: json-parse
param:
json: <!property.apiResponse>
pair:
- from: status
setValue: <@property.apiStatus>
- from: version
setValue: <@property.serverVersion>
# HTTP POST
- command: WebRequest
id: http-post
param:
url: https://api.example.com/deploy
method: POST
headers:
Content-Type: application/json
Authorization: Bearer your-token
body:
appId: com.example.app
version: <!property.version>
setResponse: <@property.deployResponse>
# HTTP 파일 다운로드
- command: WebFile
id: download-file
param:
url: https://example.com/tools/tool.zip
savePath: <!property.workspace>/tools/tool.zip
# FTP 업로드 (copyMap: local → remote)
- command: Upload
id: ftp-upload
param:
host: ftp.example.com
port: 21
id: ftp-user
password: ftp-password
copyMap:
"<!property.workspace>/release/app.ipa": "/public/releases/app.ipa"
# FTP 다운로드 (copyMap: remote → local)
- command: Download
id: ftp-download
param:
host: ftp.example.com
port: 21
id: ftp-user
password: ftp-password
copyMap:
"/public/config/app.json": "<!property.workspace>/config/app.json"