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

89 lines
2 KiB
YAML

---
# [샘플] 네트워크 / HTTP / FTP
property:
workspace: /path/to/project
version: 1.0.0
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: upload-file # HTTP multipart 파일 업로드
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
fields:
appId: com.example.app
version: <!property.version>
setResponse: <@property.deployResponse>
# HTTP multipart 파일 업로드
- command: WebFile
id: upload-file
param:
url: https://api.example.com/files
fields:
appId: com.example.app
filePart: file
fileMimeType: octet-stream
files:
- <!property.workspace>/release/app.ipa
setResponse: <@property.uploadResponse>
# FTP 업로드 (map: local relative path → remote path)
- command: Upload
id: ftp-upload
param:
host: ftp.example.com
sftp: false
port: 21
user: ftp-user
password: ftp-password
map:
"release/app.ipa": "/public/releases/app.ipa"
# FTP 다운로드 (map: local relative path → remote path)
- command: Download
id: ftp-download
param:
host: ftp.example.com
sftp: false
port: 21
user: ftp-user
password: ftp-password
map:
"config/app.json": "/public/config/app.json"