# Jobs for static site publication

- job-template:
    name: static-{name}-publish
    node: 'bare-precise || bare-trusty'

    # We want to publish to the docroot but the scp publisher cannot remove
    # paths, so use a shell builder to move the content in the right place and
    # publish from there.
    builders:
      - revoke-sudo
      - gerrit-git-prep
      - docs:
          project: '{name}'
      - shell: |
          mkdir -p .html
          mv doc/build/html/* .html/
          rm -rf *
          mv .html/* ./

    publishers:
      - scp:
          site: static.openstack.org
          files:
            - target: '{docroot}/'
              source: '**'
              keep-hierarchy: true
              copy-after-failure: false
      - console-log

# Jobs for static site publication

- job-template:
    name: static-{name}-publish
    node: 'bare-precise || bare-trusty'

    # We want to publish to the docroot but the scp publisher cannot remove
    # paths, so use a shell builder to move the content in the right place and
    # publish from there.
    builders:
      - revoke-sudo
      - gerrit-git-prep
      - docs:
          project: '{name}'
      - shell: |
          #!/bin/bash -xe
          rm -rf ,html
          mv doc/build/html ,html
          rm -rf .[^.]* [^,]*
          mv ,html/.[^.]* ,html/* ./
          rm -r ,html

    publishers:
      - scp:
          site: static.openstack.org
          files:
            - target: '{docroot}/'
              source: '**'
              keep-hierarchy: true
              copy-after-failure: false
      - console-log

Make static html publication cleaner
Make static html publication cleaner

* jenkins/jobs/static-publish-jobs.yaml: The SCP publisher
apparently globs on top-level dotdirs, so we need to take some extra
effort to purge them.

Change-Id: If7743c9cfd97a38cd38bb1ec1ed86827cc15049c
