- hosts: all
  tasks:
    # We only want to publish tar.gz file to tarballs.o.o. Find everything else
    # and delete them.
    - name: Find wheels in dist folder.
      find:
        file_type: file
        paths: "src/{{ zuul.project.canonical_name }}/dist"
        patterns: ^((?!tar\.gz).)*$
        use_regex: yes
      register: result

    - name: Delete found files that don't match *.tar.gz.
      file:
        path: "{{ item.path }}"
        state: absent
      with_items: "{{ result.files }}"

    - name: Rename tarball to branch specific name.
      shell: "mv *.tar.gz {{ zuul.project.short_name }}-{{ zuul.branch }}.tar.gz"
      args:
        chdir: "src/{{ zuul.project.canonical_name }}/dist"

- hosts: all
  tasks:
    # We only want to publish tar.gz file to tarballs.o.o. Find everything else
    # and delete them.
    - name: Find wheels in dist folder.
      find:
        file_type: file
        paths: "src/{{ zuul.project.canonical_name }}/dist"
        patterns: ^((?!tar\.gz).)*$
        use_regex: yes
      register: result

    - name: Delete found files that don't match *.tar.gz.
      file:
        path: "{{ item.path }}"
        state: absent
      with_items: "{{ result.files }}"

    - name: Rename tarball to branch specific name.
      shell: "mv *.tar.gz {{ zuul.project.short_name }}-{{ zuul.branch | replace('/', '-') }}.tar.gz"
      args:
        chdir: "src/{{ zuul.project.canonical_name }}/dist"

Replace slash for tarball rename
Replace slash for tarball rename

It is possible for a branch to be feature/zuulv3, as a result that
breaks our renaming process. Replace / with -.

Change-Id: I17aed5fc284e2a173d8e4853105a1ee30c28cad9
Signed-off-by: Paul Belanger <e7139c8e6c4ea75cc1c287ce081b2dc0f3ab39ec@redhat.com>
