- job-template:
    name: 'openstack-rpm-packaging-update-{release}'
    node: cloud-trackupstream
    description: |
      Job to update periodically Cloud:OpenStack:Upstream:{release} with data from the OpenStack rpm-packaging project.
      <b>This job is managed by JJB!</b>
      Changes must be done in <a href='https://github.com/SUSE-Cloud/automation/tree/master/jenkins/ci.opensuse.org/templates/'>git</a>

    builders:
      - shell: |
          #!/bin/bash -x
          export OSCAPI="https://api.opensuse.org"
          export OBS_PROJECT="Cloud:OpenStack:Upstream:{release}"
          export RELEASE="{release}"

          mkdir -p ~/.cache/download_files/file  ~/.cache/download_files/filename

          set -e

          if [ "{release}" != "Master" ]; then
              lcrelease="${{RELEASE,,}}"
              rm -f ${{lcrelease}}.tar.gz
              wget -c https://github.com/openstack/rpm-packaging/archive/stable/${{lcrelease}}.tar.gz
              rm -rf rpm-packaging-stable-${{lcrelease}}
              tar xf ${{lcrelease}}.tar.gz
              gitcheckout=rpm-packaging-stable-${{lcrelease}}
          else
              rm -f master.tar.gz
              wget -c https://github.com/openstack/rpm-packaging/archive/master.tar.gz
              rm -rf rpm-packaging-master
              tar xf master.tar.gz
              gitcheckout=rpm-packaging-master
          fi
          /usr/local/bin/createproject.py ${{gitcheckout}} ${{OBS_PROJECT}}

- job-template:
    name: 'openstack-rpm-packaging-update-{release}'
    node: cloud-trackupstream
    description: |
      Job to update periodically Cloud:OpenStack:Upstream:{release} with data from the OpenStack rpm-packaging project.
      <b>This job is managed by JJB!</b>
      Changes must be done in <a href='https://github.com/SUSE-Cloud/automation/tree/master/jenkins/ci.opensuse.org/templates/'>git</a>

    builders:
      - shell: |
          #!/bin/bash -x
          export OSCAPI="https://api.opensuse.org"
          export OBS_PROJECT="Cloud:OpenStack:Upstream:{release}"
          export RELEASE="{release}"

          mkdir -p ~/.cache/download_files/file  ~/.cache/download_files/filename

          set -e

          if [ "{release}" != "Master" ]; then
              lcrelease="${{RELEASE,,}}"
              rm -f ${{lcrelease}}.tar.gz
              wget -c https://opendev.org/openstack/rpm-packaging/archive/stable/${{lcrelease}}.tar.gz
              rm -rf rpm-packaging-stable-${{lcrelease}}
              tar xf ${{lcrelease}}.tar.gz
              gitcheckout=rpm-packaging-stable-${{lcrelease}}
          else
              rm -f master.tar.gz
              wget -c https://opendev.org/openstack/rpm-packaging/archive/master.tar.gz
              rm -rf rpm-packaging-master
              tar xf master.tar.gz
              gitcheckout=rpm-packaging-master
          fi
          /usr/local/bin/createproject.py ${{gitcheckout}} ${{OBS_PROJECT}}

Switch to opendev for git downloading
Switch to opendev for git downloading

The github mirror seems unreliably / asynchroneously updated, so
when the post update job runs, it doesn't get the newest state,
causing inconsistencies.

Lets see if using the master repo fixes this problem.
