<commit_before>#!/usr/bin/perl -w
#
# This tool creates a new Jenkins config file for the openstack-trackupstream-trigger job.
#
# Adapt the %tutrigger hash at the top and then run:
#  ./openstack-trackupstream-trigger.config.xml.pl > config.xml
# This file can be uploaded to river.suse.de with this command:
#  curl -X POST --data-binary @config.xml  http://river.suse.de/job/openstack-trackupstream-trigger/config.xml
#

my %tutrigger = (
  Head => [ qw(
    openstack-dashboard
    openstack-nova
    openstack-glance
    openstack-keystone
    openstack-melange
    openstack-quantum
    openstack-swift
    python-keystoneclient
    python-novaclient
    python-quantumclient
    python-melangeclient
    python-swiftclient
  ) ],
  Crowbar => [ qw(
    crowbar
    crowbar-barclamp-ceph
    crowbar-barclamp-crowbar
    crowbar-barclamp-database
    crowbar-barclamp-deployer
    crowbar-barclamp-dns
    crowbar-barclamp-ganglia
    crowbar-barclamp-glance
    crowbar-barclamp-ipmi
    crowbar-barclamp-keystone
    crowbar-barclamp-kong
    crowbar-barclamp-logging
    crowbar-barclamp-nagios
    crowbar-barclamp-network
    crowbar-barclamp-nova
    crowbar-barclamp-nova_dashboard
    crowbar-barclamp-ntp
    crowbar-barclamp-openstack
    crowbar-barclamp-provisioner
    crowbar-barclamp-swift
    crowbar-barclamp-test
 ) ]
);


foreach my $subp (keys %tutrigger)
{
  open (my $FH, '>', "$subp.config.xml") or die $@;
  select $FH;

print
q{<?xml version='1.0' encoding='UTF-8'?>
<project>
  <actions/>
  <description>This is the meta job that triggers the openstack-trackupstream job multiple times with different parameters.&lt;br /&gt;&#xd;
&lt;b&gt;Add new packages as new triggers to THIS job (see config and scroll down).&lt;/b&gt;</description>
  <keepDependencies>false</keepDependencies>
  <properties/>
  <scm class="hudson.scm.NullSCM"/>
  <assignedNode>openstack-trackupstream</assignedNode>
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers class="vector">
    <hudson.triggers.TimerTrigger>
      <spec></spec>
    </hudson.triggers.TimerTrigger>
  </triggers>
  <concurrentBuild>false</concurrentBuild>
  <builders/>
  <publishers>
    <hudson.plugins.parameterizedtrigger.BuildTrigger>
      <configs>
};

  foreach my $pack (@{$tutrigger{$subp}})
  {
    print
qq~
        <hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
          <configs>
            <hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
              <properties>COMPONENT=$pack
SUBPROJECT=$subp
</properties>
            </hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
          </configs>
          <projects>openstack-trackupstream, </projects>
          <condition>ALWAYS</condition>
          <triggerWithNoParameters>false</triggerWithNoParameters>
        </hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
~;
  }


print
q{
      </configs>
    </hudson.plugins.parameterizedtrigger.BuildTrigger>
  </publishers>
  <buildWrappers/>
</project>
};

select STDOUT;
close $FH;

}

print "\nConfigs created locally\n";
print "Please update the jenkins config by running these commands:\n";

foreach my $subp (keys %tutrigger)
{
  my $jobname=lc($subp);
  $jobname="openstack" if ($jobname eq 'head');
  print '# curl -X POST --data-binary @'."$subp.config.xml http://river.suse.de/job/cloud-trackupstream-$jobname-trigger/config.xml\n";
}<commit_msg>adapt trigger creator to new project layout<commit_after>#!/usr/bin/perl -w
#
# This tool creates a new Jenkins config file for the openstack-trackupstream-trigger job.
#
# Adapt the %tutrigger hash at the top and then run:
#  ./openstack-trackupstream-trigger.config.xml.pl > config.xml
# This file can be uploaded to river.suse.de with this command:
#  curl -X POST --data-binary @config.xml  http://river.suse.de/job/openstack-trackupstream-trigger/config.xml
#

my %tutrigger = (
  "1.0:OpenStack" => [ qw(
    openstack-dashboard
    openstack-nova
    openstack-glance
    openstack-keystone
    openstack-melange
    openstack-quantum
    openstack-swift
    python-keystoneclient
    python-novaclient
    python-quantumclient
    python-melangeclient
    python-swiftclient
  ) ],
  Crowbar => [ qw(
    crowbar
    crowbar-barclamp-ceph
    crowbar-barclamp-crowbar
    crowbar-barclamp-database
    crowbar-barclamp-deployer
    crowbar-barclamp-dns
    crowbar-barclamp-ganglia
    crowbar-barclamp-glance
    crowbar-barclamp-ipmi
    crowbar-barclamp-keystone
    crowbar-barclamp-kong
    crowbar-barclamp-logging
    crowbar-barclamp-nagios
    crowbar-barclamp-network
    crowbar-barclamp-nova
    crowbar-barclamp-nova_dashboard
    crowbar-barclamp-ntp
    crowbar-barclamp-openstack
    crowbar-barclamp-provisioner
    crowbar-barclamp-swift
    crowbar-barclamp-test
 ) ],
 "1.0:Crowbar" => [ qw(
    crowbar
    crowbar-barclamp-ceph
    crowbar-barclamp-crowbar
    crowbar-barclamp-database
    crowbar-barclamp-deployer
    crowbar-barclamp-dns
    crowbar-barclamp-ganglia
    crowbar-barclamp-glance
    crowbar-barclamp-ipmi
    crowbar-barclamp-keystone
    crowbar-barclamp-kong
    crowbar-barclamp-logging
    crowbar-barclamp-nagios
    crowbar-barclamp-network
    crowbar-barclamp-nova
    crowbar-barclamp-nova_dashboard
    crowbar-barclamp-ntp
    crowbar-barclamp-openstack
    crowbar-barclamp-provisioner
    crowbar-barclamp-swift
    crowbar-barclamp-test
 ) ]
);


foreach my $subp (keys %tutrigger)
{
  my $jobname = $subp;
  $jobname =~ s/:/-/g;
  open (my $FH, '>', "$jobname.config.xml") or die $@;
  select $FH;

print
q{<?xml version='1.0' encoding='UTF-8'?>
<project>
  <actions/>
  <description>This is the meta job that triggers the openstack-trackupstream job multiple times with different parameters.&lt;br /&gt;&#xd;
&lt;b&gt;Add new packages ONLY via &lt;i&gt;openstack-trackupstream-trigger.config.xml.pl&lt;/i&gt; tool from the automation repo.&lt;/b&gt;</description>
  <keepDependencies>false</keepDependencies>
  <properties/>
  <scm class="hudson.scm.NullSCM"/>
  <assignedNode>openstack-trackupstream</assignedNode>
  <canRoam>false</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers class="vector">
    <hudson.triggers.TimerTrigger>
      <spec></spec>
    </hudson.triggers.TimerTrigger>
  </triggers>
  <concurrentBuild>false</concurrentBuild>
  <builders/>
  <publishers>
    <hudson.plugins.parameterizedtrigger.BuildTrigger>
      <configs>
};

  foreach my $pack (@{$tutrigger{$subp}})
  {
    print
qq~
        <hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
          <configs>
            <hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
              <properties>COMPONENT=$pack
SUBPROJECT=$subp
</properties>
            </hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
          </configs>
          <projects>openstack-trackupstream, </projects>
          <condition>ALWAYS</condition>
          <triggerWithNoParameters>false</triggerWithNoParameters>
        </hudson.plugins.parameterizedtrigger.BuildTriggerConfig>
~;
  }


print
q{
      </configs>
    </hudson.plugins.parameterizedtrigger.BuildTrigger>
  </publishers>
  <buildWrappers/>
</project>
};

select STDOUT;
close $FH;

}

print "\nConfigs created locally\n";
print "Please update the jenkins config by running these commands:\n";

foreach my $subp (keys %tutrigger)
{
  my $jobname=$subp;
  $jobname =~ s/:/-/g;
  print '# curl -X POST --data-binary @'."$jobname.config.xml http://river.suse.de/job/cloud-trackupstream-$jobname-trigger/config.xml\n";
}
{'fraction_non_alphanumeric': 0.11819338422391858, 'fraction_numerical': 0.001272264631043257, 'mean_word_length': 3.6350235849056602, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 2, '>': 112, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 17}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4228808', 'n_tokens_mistral': 2758, 'n_tokens_neox': 2668, 'n_words': 454}