-
Notifications
You must be signed in to change notification settings - Fork 0
implement when clause for conditional actions #409
Copy link
Copy link
Open
Labels
featureNew feature or requestNew feature or request
Description
# ==========================
# Actions
# ==========================
actions:
# Transcode video with medium quality
komp-2:
cmd: "ffmpeg -i {{.path}} -q:v 2 {{.dir}}/{{.stem}}.mp4"
# Only apply to large video files
when: "isVideo && isLarge && !isHidden"
# Transcode video with lower quality
komp-18:
cmd: "ffmpeg -i {{.path}} -q:v 18 {{.dir}}/{{.stem}}.mp4"
when: "isVideo && size > 50MB"
# Upload to S3 bucket if transcoded file exists
upload-s3:
cmd: "aws s3 cp {{.dir}}/{{.stem}}.mp4 s3://mybucket/"
when: "exists({{.dir}}/{{.stem}}.mp4)"
# Generate a thumbnail for video
thumbnail:
cmd: "ffmpeg -i {{.path}} -vf 'thumbnail' -frames:v 1 {{.dir}}/{{.stem}}.jpg"
when: "isVideo"
# ==========================
# Pipelines
# ==========================
pipelines:
# Full video workflow: transcode + thumbnail + upload
video-workflow:
steps:
- komp-2
- thumbnail
- upload-s3
# Quick low-quality workflow
quick-transcode:
steps:
- komp-18
- upload-s3Other place-holders:
{{.path}}, {{.name}}, {{.dir}}, {{.stem}}, etc.Conditional actions:
when: "isVideo && isLarge && !isHidden"Use a simple embedded DSL
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request