   (->> (concat (stages-for-pipeline-group "Development")
                (stages-for-pipeline-group "Verification")
                (stages-for-pipeline-group "Production"))
-       (map job-instances-for-stage)
-       (apply concat)
+       (mapcat job-instances-for-stage)
        (map augment-job-with-inputs)
        (map job-data-for-instance)))
 

  (let [stageHistory (get-json "/api/stages/%s/%s/history" pipeline stage)
        stageInstances (:stages stageHistory)]
    (map #(assoc % :stageName stage :pipelineName pipeline)
         (apply concat
                (map job-instances-for-stage-instance stageInstances)))))


;; /api/pipelines/%pipelines/instance/%run

  (let [pipelineGroups (get-json "/api/config/pipeline_groups")
        pipelineGroup (first (filter #(= pipelineGroupName (:name %)) pipelineGroups))
        pipelines (:pipelines pipelineGroup)]
    (mapcat stages-for-pipeline pipelines)))


;; upload
