YAML语法说明
最后更新于
这有帮助吗?
这有帮助吗?
tasks:
hello-world:
container:
image: alpine:latest
command: [echo]
args: ["hello world!"]
env:
- name: GAS-URL
value: https://gas.graviti.cntasks:
hello-script-task:
script:
image: python:alpine3.8
command: [python]
source: |
import logging
import os
import sys
import time
logging.basicConfig(level=logging.INFO)
logging.info('environment was:')
for key, value in os.environ.items():
logging.info(f'\t{key} = {value}')
args = sys.argv
count = 20
if len(args) > 1:
count = int(args[1])
logging.info(f'count was {count}')
idx = 0
while idx < count:
logging.info(f'loop at index {idx}.')
idx += 1
time.sleep(1)
logging.info('complete')tasks:
hello:
git:
image: python:3.9.5-buster
command: ["python3"]
args: ["main.py"]
repo: https://github.com/username/repository.git@reversiontasks:
taskA:
container:
image: johngraviti/count_down:v0.1
command: [python]
args: [/root/main.py, 40]
taskB:
dependencies:
- taskA
container:
image: johngraviti/count_down:v0.1
command: [python]
args: [/root/main.py, 60]
taskC:
dependencies:
- taskA
container:
image: johngraviti/count_down:v0.1
command: [python]
args: [/root/main.py, 120]
taskD:
dependencies:
- taskB
- taskC
container:
image: johngraviti/count_down:v0.1
command: [python]
args: [/root/main.py, 70]tasks:
hello-world:
container:
image: alpine:latest
command: [echo]
args: ["{{workflow.parameters.foo}}" "{{workflow.parameters.bar}}"]