# simply copy the contents of the repository to the server, no building needed
- job:
    name: infra-publications-publish
    concurrent: false
    node: precise

    builders:
      - gerrit-git-prep
      - shell: |
          #!/bin/bash -x
          # NAME will either be the branch name or the tag name
          NAME=`echo $ZUUL_REFNAME | sed 's/refs.tags.//'`
          mkdir -p _out/$NAME
          mv * _out/$NAME

    publishers:
      - ftp:
          site: docs.openstack.org
          source: '_out/**'
          target: 'infra/publications/'
          remove-prefix: '_out/'
          excludes: ''
      - console-log

- job:
    name: infra-publications-publish-index
    concurrent: false
    node: precise

    builders:
      - gerrit-git-prep
      - shell: |
          #!/bin/bash -xe
          git reset --hard remotes/origin/master
          if ! git clean -x -f -d -q ; then
              sleep 1
              git clean -x -f -d -q
          fi
          ./make-index

    publishers:
      - ftp:
          site: docs.openstack.org
          source: 'output/**'
          target: 'infra/publications/'
          remove-prefix: 'output/'
          excludes: ''
      - console-log

# simply copy the contents of the repository to the server, no building needed
- job:
    name: infra-publications-publish
    concurrent: false
    node: precise

    builders:
      - gerrit-git-prep
      - shell: |
          #!/bin/bash -x
          # NAME will either be the branch name or the tag name
          NAME=`echo $ZUUL_REFNAME | sed 's/refs.tags.//'`
          mkdir -p _out/$NAME
          for FN in * ; do
              if [ "_out" != "$FN" ] ; then
                  mv $FN _out/$NAME/
              fi
          done

    publishers:
      - ftp:
          site: docs.openstack.org
          source: '_out/**'
          target: 'infra/publications/'
          remove-prefix: '_out/'
          excludes: ''
      - console-log

- job:
    name: infra-publications-publish-index
    concurrent: false
    node: precise

    builders:
      - gerrit-git-prep
      - shell: |
          #!/bin/bash -xe
          git reset --hard remotes/origin/master
          if ! git clean -x -f -d -q ; then
              sleep 1
              git clean -x -f -d -q
          fi
          ./make-index

    publishers:
      - ftp:
          site: docs.openstack.org
          source: 'output/**'
          target: 'infra/publications/'
          remove-prefix: 'output/'
          excludes: ''
      - console-log

Exclude target subdir from source for infra pubs
Exclude target subdir from source for infra pubs

* infra-publications.yaml: Address the "cannot move _out to a
subdirectory of itself" error which prematurely terminates the
infra-publications-publish job.

Change-Id: I091f5e9f6efe3e32295cc139c2db2b5e58c8924c
