diff --git a/actions/workflows/st2_pkg_e2e_test.yaml b/actions/workflows/st2_pkg_e2e_test.yaml index 75fa96d..2f1b28e 100644 --- a/actions/workflows/st2_pkg_e2e_test.yaml +++ b/actions/workflows/st2_pkg_e2e_test.yaml @@ -36,6 +36,7 @@ vars: distro: versions: version_str: not installed + - pipe_into_bootstrap_script: "" - bootstrap_script_url: <% coalesce(ctx().bootstrap_script, "https://raw.githubusercontent.com/StackStorm/st2-packages/" + ctx().bootstrap_branch + "/scripts/st2_bootstrap.sh") %> - bootstrap_script_arg_dev_or_ver: <% switch( @@ -99,12 +100,26 @@ tasks: publish: - vm_info: <% result().output.vm_info %> - vm_id: <% result().output.vm_info.id %> - do: get_bootstrap_script + do: check_for_ubuntu_xenial - when: <% failed() %> publish: - vm_id: <% result().output.get("vm_info", {}).get("id") %> - failed: True do: cleanup + check_for_ubuntu_xenial: + action: core.remote + input: + hosts: <% ctx().vm_info.private_ip_address %> + cmd: cat /etc/issue + next: + - when: <% succeeded() and "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %> + publish: + - pipe_into_bootstrap_script: "echo 'y'" + do: get_bootstrap_script + - when: <% succeeded() and not "Ubuntu 16" in result().get(ctx().vm_info.private_ip_address).stdout %> + do: get_bootstrap_script + - when: <% failed() %> + do: check_debug_mode get_bootstrap_script: action: core.remote_sudo input: @@ -117,7 +132,10 @@ tasks: action: core.remote_sudo input: hosts: <% ctx().vm_info.private_ip_address %> + # If pipe_into_bootstrap_script is not empty, return it + " | " + # If pipe_into_bootstrap_script is empty, return an empty string cmd: >- + <% switch(ctx().pipe_into_bootstrap_script => concat(ctx().pipe_into_bootstrap_script, " | "), true => "") %> bash /tmp/st2_bootstrap.sh --<% ctx().pkg_env %> --<% ctx().release %>