version: '2.0'

st2ci.setup_st2:
    description: Setup a running instance of StackStorm from git repo.
    type: direct
    input:
        - host
        - repo
        - repo_branch
        - repo_dir
        - debug

    output:
        clone_path: <% $.clone_path %>

    task-defaults:
        on-error:
            - teardown: <% not $.debug %>
            - fail: <% $.debug %>

    tasks:
        clone_repo:
            action: st2cd.git_clone
            input:
                hosts: <% $.host %>
                repo: <% $.repo %>
                branch: <% $.repo_branch %>
                target: <% $.repo_dir %>/st2_<% $.repo_branch %>
            retry:
                count: 3
                delay: 3
            publish:
                clone_path: <% task(clone_repo).result.get($.host).stdout %>
            on-success:
                - install

        install:
            action: st2ci.install_st2
            input:
                hosts: <% $.host %>
                repo: <% $.clone_path %>
            on-success:
                - start_service

        start_service:
            action: core.remote
            input:
                hosts: <% $.host %>
                cmd: <% $.clone_path %>/tools/launchdev.sh stop & <% $.clone_path %>/tools/launchdev.sh startclean -g -x



        # Declare error handler(s) here
        teardown:
            action: st2ci.teardown_st2
            input:
                host: <% $.host %>
                repo: <% $.clone_path %>
            on-complete:
                - fail

version: '2.0'

st2ci.setup_st2:
    description: Setup a running instance of StackStorm from git repo.
    type: direct
    input:
        - host
        - repo
        - repo_branch
        - repo_dir
        - debug

    output:
        clone_path: <% $.clone_path %>

    task-defaults:
        on-error:
            - teardown: <% not $.debug %>
            - fail: <% $.debug %>

    tasks:
        clone_repo:
            action: st2cd.git_clone
            input:
                hosts: <% $.host %>
                repo: <% $.repo %>
                branch: <% $.repo_branch %>
                target: <% $.repo_dir %>/st2_<% $.repo_branch %>
                timeout: 120
            retry:
                count: 3
                delay: 3
            publish:
                clone_path: <% task(clone_repo).result.get($.host).stdout %>
            on-success:
                - install

        install:
            action: st2ci.install_st2
            input:
                hosts: <% $.host %>
                repo: <% $.clone_path %>
            on-success:
                - start_service

        start_service:
            action: core.remote
            input:
                hosts: <% $.host %>
                cmd: <% $.clone_path %>/tools/launchdev.sh stop & <% $.clone_path %>/tools/launchdev.sh startclean -g -x



        # Declare error handler(s) here
        teardown:
            action: st2ci.teardown_st2
            input:
                host: <% $.host %>
                repo: <% $.clone_path %>
            on-complete:
                - fail

Increase timeout for git clone st2 repo step
Increase timeout for git clone st2 repo step

The git clone of st2 repo is approaching close to 60 seconds on more than a few occasions.
