export TYPE='type=application/octet-stream'
cd demo
+echo 'next up:'
#minimal job definition
cat mini.yml
-curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@demo/mini.yml;$TYPE"
+curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@mini.yml;$TYPE"
+echo 'next up:'
#pull file from target
cat pull.yml
-curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@demo/pull.yml;$TYPE"
+curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@pull.yml;$TYPE"
+echo 'next up:'
#push file to target
cat push.yml
-curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@demo/push.yml;$TYPE"
+curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@push.yml;$TYPE"
+echo 'next up:'
#run pushed script on the target
colordiff push.yml script.yml
-curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@demo/script.yml;$TYPE"
+curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@script.yml;$TYPE"
+echo 'next up:'
#run jobs in parallel
for JOB in `seq 1 3`; do curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@demo/parallel.yml;$TYPE" | jq '.jobid' | tee -a jobids; done
+echo 'next up:'
#cancel no longer necessary jobs
while read JOBID; do curl -sL -X POST "localhost:5010/api/v1/jobs/${JOBID}/cancel"; done < jobids
+echo 'next up:'
#flash only necessary partitions
colordiff mini.yml parts.yml
-curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@demo/parts.yml;$TYPE"
+curl -sL localhost:5010/api/v1/jobs/ -F "uploadfile=@parts.yml;$TYPE"