--- ############################################################################## # Copyright 2018 Parker Berberian and Others # # # # Licensed under the Apache License, Version 2.0 (the License); # # you may not use this file except in compliance with the License. # # You may obtain a copy of the License at # # # # http://www.apache.org/licenses/LICENSE-2.0 # # # # Unless required by applicable law or agreed to in writing, software # # distributed under the License is distributed on an AS IS BASIS, # # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # # limitations under the License. # ############################################################################## version: '2.0' laas.software_master_workflow: description: fulfills all software tasks from the dashboard input: - job_id tasks: jenkins: action: core.local input: cmd: "echo 'use laas.jenkins_workflow'" on-complete: get_tasks get_tasks: action: laas.get_task_list input: job_id: <% $.job_id %> type: "software" publish: tasklist: <% task(get_tasks).result.result %> on-success: - get_start_index get_start_index: action: core.local cmd="echo 0" publish: index: <% int(task(get_start_index).result.stdout) %> on-success: - finish: <% $.index >= len($.tasklist) %> - software_task: <% $.index < len($.tasklist) %> loop: action: core.local input: cmd: 'echo $((<% $.index %>+1))' publish: index: <% task(loop).result.stdout %> on-success: - finish: <% $.index >= len($.tasklist) %> - software_task: <% $.index < len($.tasklist) %> software_task: action: laas.software_workflow input: task_id: <% $.tasklist[$.index] %> job_id: <% $.job_id %> on-complete: - loop finish: action: core.local cmd="exit 0" on-success: succeed