---
version: '1.0'
description: Stage bwc packages for release.
input:
  - version
  - projects
  - username: stackstorm
  - wait
  - distros:
      RHEL6: el6
      RHEL7: el7
      UBUNTU14: u14
      UBUNTU16: u16
      UBUNTU18: u18
tasks:
  init:
    action: core.local
    input:
      cmd: echo <% ctx().version %> | cut -d "." -f1-2
    next:
      - when: <% succeeded() %>
        publish:
          - branch: v<% result().stdout %>
        do:
          - package_all
  package_all:
    with:
      items: project in <% ctx().projects %>
    action: circle_ci.run_build
    input:
      project: <% item(project) %>
      username: <% ctx().username %>
      branch: <% ctx().branch %>
    next:
      - when: <% succeeded() and (ctx().wait) %>
        publish:
          - package_jobs: <% result().select( [$.result.reponame, $.result.build_num]) %>
        do:
          - wait_for_packages
  wait_for_packages:
    with:
      items: package_job in <% ctx().package_jobs %>
    action: st2cd.wait_for_package
    input:
      project: <% item(package_job)[0] %>
      username: <% ctx().username %>
      build_number: <% str(item(package_job)[1]) %>

---
version: '1.0'
description: Stage bwc packages for release.
input:
  - version
  - projects
  - username: stackstorm
  - wait
  - distros:
      RHEL6: el6
      RHEL7: el7
      UBUNTU14: u14
      UBUNTU16: u16
      UBUNTU18: u18
tasks:
  init:
    action: core.local
    input:
      cmd: echo -n '"'; echo -n <% ctx().version %> | cut -d "." -f1-2 | tr -d '\n'; echo -n '"'
    next:
      - when: <% succeeded() %>
        publish:
          - branch: v<% result().stdout %>
        do:
          - package_all
  package_all:
    with:
      items: project in <% ctx().projects %>
    action: circle_ci.run_build
    input:
      project: <% item(project) %>
      username: <% ctx().username %>
      branch: <% ctx().branch %>
    next:
      - when: <% succeeded() and (ctx().wait) %>
        publish:
          - package_jobs: <% result().select( [$.result.reponame, $.result.build_num]) %>
        do:
          - wait_for_packages
  wait_for_packages:
    with:
      items: package_job in <% ctx().package_jobs %>
    action: st2cd.wait_for_package
    input:
      project: <% item(package_job)[0] %>
      username: <% ctx().username %>
      build_number: <% str(item(package_job)[1]) %>

Fix float interpolation by removing newlines and echoing quotes around version string
Fix float interpolation by removing newlines and echoing quotes around version string

See execution 5c6e47d516f3ad79c1dd7d49
