<commit_before>- job:
    name: 'cloud-trackupstream'
    project-type: matrix

    triggers:
      - timed: 'H 5,19 * * *'

    logrotate:
      numToKeep: -1
      daysToKeep: 30

    axes:
      - axis:
          type: user-defined
          name: component
          values:
            - crowbar
            - crowbar-ui
            - crowbar-core
            - crowbar-openstack
            - crowbar-ceph
            - crowbar-ha
            - crowbar-hyperv
            - crowbar-init
            - openstack-dashboard-theme-SUSE
            - release-notes-suse-openstack-cloud
            - crowbar-barclamp-bios
            - crowbar-barclamp-ceilometer
            - crowbar-barclamp-ceph
            - crowbar-barclamp-cinder
            - crowbar-barclamp-cisco-ucs
            - crowbar-barclamp-crowbar
            - crowbar-barclamp-database
            - crowbar-barclamp-deployer
            - crowbar-barclamp-dns
            - crowbar-barclamp-ganglia
            - crowbar-barclamp-glance
            - crowbar-barclamp-heat
            - crowbar-barclamp-hyperv
            - crowbar-barclamp-ipmi
            - crowbar-barclamp-keystone
            - crowbar-barclamp-logging
            - crowbar-barclamp-manila
            - crowbar-barclamp-nagios
            - crowbar-barclamp-network
            - crowbar-barclamp-nfs_client
            - crowbar-barclamp-nova
            - crowbar-barclamp-nova_dashboard
            - crowbar-barclamp-ntp
            - crowbar-barclamp-openstack
            - crowbar-barclamp-pacemaker
            - crowbar-barclamp-provisioner
            - crowbar-barclamp-neutron
            - crowbar-barclamp-rabbitmq
            - crowbar-barclamp-raid
            - crowbar-barclamp-suse-manager-client
            - crowbar-barclamp-swift
            - crowbar-barclamp-tempest
            - crowbar-barclamp-trove
            - crowbar-barclamp-updater
      - axis:
          type: user-defined
          name: project
          values:
            - Devel:Cloud:6:Staging
            - Devel:Cloud:6:SAP:Staging
            - Devel:Cloud:7:Staging
      - axis:
          type: slave
          name: label
          values:
            - openstack-trackupstream
    execution-strategy:
      combination-filter: |
        !(
          (
            [
              "Devel:Cloud:6:Staging"
            ].contains(project) &&
            [
              "crowbar-init"
            ].contains(component)
          )
          ||
          (
            [
              "Devel:Cloud:6:SAP:Staging"
            ].contains(project) &&
            [
              "crowbar-ui",
              "crowbar-hyperv",
              "crowbar-init",
              "openstack-dashboard-theme-SUSE",
              "release-notes-suse-openstack-cloud"
            ].contains(component)
          )
        )
      sequential: true
    builders:
      - shell: |
          PROJECTSOURCE=IBS/${project}
          COMPONENT=$component

          # needs .oscrc with user,pass,trusted_prj
          # zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools/SLE_11_SP2/openSUSE:Tools.repo
          # zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools:/Unstable/SLE_11_SP2/openSUSE:Tools:Unstable.repo
          # zypper in osc obs-service-tar_scm obs-service-github_tarballs obs-service-recompress obs-service-git_tarballs obs-service-set_version obs-service-refresh_patches
          [ -z "$PROJECTSOURCE" ] && ( echo "Error: no PROJECTSOURCE defined." ; exit 1 )

          export automationrepo=~/github.com/SUSE-Cloud/automation
          export jtsync=${automationrepo}/scripts/jtsync/jtsync.rb

          function jtsync_trap() {
            $jtsync --ci suse --matrix ${JOB_BASE_NAME},${project},${BUILD_NUMBER} 1
          }

          # only enable jtsync when build is not manually triggered
          if [[ "${ROOT_BUILD_CAUSE}" != "MANUALTRIGGER" ]]; then
            trap jtsync_trap EXIT ERR
          fi

          # automation bootstrapping
          if ! [ -e ${automationrepo}/scripts/jenkins/update_automation ] ; then
              rm -rf ${automationrepo}
              curl https://raw.githubusercontent.com/SUSE-Cloud/automation/master/scripts/jenkins/update_automation | bash
          fi
          ${automationrepo}/scripts/jenkins/update_automation

          OBS_TYPE=${PROJECTSOURCE%%/*}
          OBS_PROJECT=${PROJECTSOURCE##*/}

          BUILD_DIST=SLE_12_SP2
          OSC_BUILD_ARCH=x86_64

          case $project in
              Devel:Cloud:6*)
                  BUILD_DIST=SLE_12_SP1
                  ;;
          esac


          case $OBS_TYPE in
            OBS) OSCAPI="https://api.opensuse.org"
                OSC_BUILD_DIST=$BUILD_DIST
                ;;
            IBS) OSCAPI="https://api.suse.de"
                OSC_BUILD_DIST=$BUILD_DIST
                ;;
            *)   echo "This jenkins instance only interacts with OBS or IBS."
                exit 1
                ;;
          esac

          # remove accidentally added spaces
          COMPONENT=${COMPONENT// /}
          OBS_PROJECT=${OBS_PROJECT// /}

          if [ -z "$COMPONENT" ] ; then
              echo "Error: Variable COMPONENT is unset."
              exit 1
          fi

          export OSCAPI
          export OSC_BUILD_DIST
          export OSC_BUILD_ARCH

          export JHOME=/home/jenkins
          export BS_CHECKOUT=$JHOME/${OBS_TYPE}_CHECKOUT/$OBS_PROJECT
          export OSC_BUILD_ROOT=$JHOME/buildroot

          mkdir -p ~/.obs
          for i in incoming repo repourl
          do
              mkdir -p $JHOME/obscache/tar_scm/$i
          done
          echo "CACHEDIRECTORY=\"$JHOME/obscache/tar_scm\"" > ~/.obs/tar_scm

          mkdir -p "$BS_CHECKOUT"
          cd "$BS_CHECKOUT"

          rm -rf "$COMPONENT"
          osc -A $OSCAPI co -c "$OBS_PROJECT" "$COMPONENT"

          [ -d "$COMPONENT" ] || ( echo "Error: Component $COMPONENT does not exist (yet) or has been removed."  ; exit 1 )
          cd "$COMPONENT"

          grep -q "<linkinfo" .osc/_files || exit 2

          ${automationrepo}/scripts/jenkins/track-upstream-and-package.pl
          ret=$?

          # only enable jtsync when build is not manually triggered
          if [[ "${ROOT_BUILD_CAUSE}" != "MANUALTRIGGER" ]]; then
            trap - EXIT ERR
            $jtsync --ci suse --matrix ${JOB_BASE_NAME},${project},${BUILD_NUMBER} $ret
          fi
          exit $ret
<commit_msg>trackupstream: Drop old Cloud 5 barclamps<commit_after>- job:
    name: 'cloud-trackupstream'
    project-type: matrix

    triggers:
      - timed: 'H 5,19 * * *'

    logrotate:
      numToKeep: -1
      daysToKeep: 30

    axes:
      - axis:
          type: user-defined
          name: component
          values:
            - crowbar
            - crowbar-ui
            - crowbar-core
            - crowbar-openstack
            - crowbar-ceph
            - crowbar-ha
            - crowbar-hyperv
            - crowbar-init
            - openstack-dashboard-theme-SUSE
            - release-notes-suse-openstack-cloud
      - axis:
          type: user-defined
          name: project
          values:
            - Devel:Cloud:6:Staging
            - Devel:Cloud:6:SAP:Staging
            - Devel:Cloud:7:Staging
      - axis:
          type: slave
          name: label
          values:
            - openstack-trackupstream
    execution-strategy:
      combination-filter: |
        !(
          (
            [
              "Devel:Cloud:6:Staging"
            ].contains(project) &&
            [
              "crowbar-init"
            ].contains(component)
          )
          ||
          (
            [
              "Devel:Cloud:6:SAP:Staging"
            ].contains(project) &&
            [
              "crowbar-ui",
              "crowbar-hyperv",
              "crowbar-init",
              "openstack-dashboard-theme-SUSE",
              "release-notes-suse-openstack-cloud"
            ].contains(component)
          )
        )
      sequential: true
    builders:
      - shell: |
          PROJECTSOURCE=IBS/${project}
          COMPONENT=$component

          # needs .oscrc with user,pass,trusted_prj
          # zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools/SLE_11_SP2/openSUSE:Tools.repo
          # zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools:/Unstable/SLE_11_SP2/openSUSE:Tools:Unstable.repo
          # zypper in osc obs-service-tar_scm obs-service-github_tarballs obs-service-recompress obs-service-git_tarballs obs-service-set_version obs-service-refresh_patches
          [ -z "$PROJECTSOURCE" ] && ( echo "Error: no PROJECTSOURCE defined." ; exit 1 )

          export automationrepo=~/github.com/SUSE-Cloud/automation
          export jtsync=${automationrepo}/scripts/jtsync/jtsync.rb

          function jtsync_trap() {
            $jtsync --ci suse --matrix ${JOB_BASE_NAME},${project},${BUILD_NUMBER} 1
          }

          # only enable jtsync when build is not manually triggered
          if [[ "${ROOT_BUILD_CAUSE}" != "MANUALTRIGGER" ]]; then
            trap jtsync_trap EXIT ERR
          fi

          # automation bootstrapping
          if ! [ -e ${automationrepo}/scripts/jenkins/update_automation ] ; then
              rm -rf ${automationrepo}
              curl https://raw.githubusercontent.com/SUSE-Cloud/automation/master/scripts/jenkins/update_automation | bash
          fi
          ${automationrepo}/scripts/jenkins/update_automation

          OBS_TYPE=${PROJECTSOURCE%%/*}
          OBS_PROJECT=${PROJECTSOURCE##*/}

          BUILD_DIST=SLE_12_SP2
          OSC_BUILD_ARCH=x86_64

          case $project in
              Devel:Cloud:6*)
                  BUILD_DIST=SLE_12_SP1
                  ;;
          esac


          case $OBS_TYPE in
            OBS) OSCAPI="https://api.opensuse.org"
                OSC_BUILD_DIST=$BUILD_DIST
                ;;
            IBS) OSCAPI="https://api.suse.de"
                OSC_BUILD_DIST=$BUILD_DIST
                ;;
            *)   echo "This jenkins instance only interacts with OBS or IBS."
                exit 1
                ;;
          esac

          # remove accidentally added spaces
          COMPONENT=${COMPONENT// /}
          OBS_PROJECT=${OBS_PROJECT// /}

          if [ -z "$COMPONENT" ] ; then
              echo "Error: Variable COMPONENT is unset."
              exit 1
          fi

          export OSCAPI
          export OSC_BUILD_DIST
          export OSC_BUILD_ARCH

          export JHOME=/home/jenkins
          export BS_CHECKOUT=$JHOME/${OBS_TYPE}_CHECKOUT/$OBS_PROJECT
          export OSC_BUILD_ROOT=$JHOME/buildroot

          mkdir -p ~/.obs
          for i in incoming repo repourl
          do
              mkdir -p $JHOME/obscache/tar_scm/$i
          done
          echo "CACHEDIRECTORY=\"$JHOME/obscache/tar_scm\"" > ~/.obs/tar_scm

          mkdir -p "$BS_CHECKOUT"
          cd "$BS_CHECKOUT"

          rm -rf "$COMPONENT"
          osc -A $OSCAPI co -c "$OBS_PROJECT" "$COMPONENT"

          [ -d "$COMPONENT" ] || ( echo "Error: Component $COMPONENT does not exist (yet) or has been removed."  ; exit 1 )
          cd "$COMPONENT"

          grep -q "<linkinfo" .osc/_files || exit 2

          ${automationrepo}/scripts/jenkins/track-upstream-and-package.pl
          ret=$?

          # only enable jtsync when build is not manually triggered
          if [[ "${ROOT_BUILD_CAUSE}" != "MANUALTRIGGER" ]]; then
            trap - EXIT ERR
            $jtsync --ci suse --matrix ${JOB_BASE_NAME},${project},${BUILD_NUMBER} $ret
          fi
          exit $ret

{'fraction_non_alphanumeric': 0.10130270826191293, 'fraction_numerical': 0.005913609873157353, 'mean_word_length': 1.4949754115886251, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6709177', 'n_tokens_mistral': 3628, 'n_tokens_neox': 3479, 'n_words': 611}