Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-11-07 20:27:56 +0000
committerFrank Becker2012-11-07 20:27:56 +0000
commit282f494a6603fcedf5b9b420945d6258ea6feaf9 (patch)
tree5dd83f12369262b4cb771eafd68036c060af1563 /org.eclipse.mylyn.bugzilla.releng/modules
parent5f50290b515c1b7c4073c62dd0b576a88ae0b851 (diff)
downloadorg.eclipse.mylyn.tasks-282f494a6603fcedf5b9b420945d6258ea6feaf9.tar.gz
org.eclipse.mylyn.tasks-282f494a6603fcedf5b9b420945d6258ea6feaf9.tar.xz
org.eclipse.mylyn.tasks-282f494a6603fcedf5b9b420945d6258ea6feaf9.zip
393640: create puppet configuration for Bugzilla
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=393640 Change-Id: I462d10fbd42c4d703e4db6ffb68dceca701c4289
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.releng/modules')
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/Config.pm29
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/lib/Util.pm25
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/index.php3
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp144
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp113
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb448
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb18
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/apache2.conf.erb9
-rw-r--r--org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/xmlrpc.cgi.erb12
9 files changed, 801 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/Config.pm b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/Config.pm
new file mode 100644
index 000000000..0e47fa8c7
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/Config.pm
@@ -0,0 +1,29 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2012 Frank Becker and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Frank Becker - initial API and implementation
+#
+
+package Bugzilla::Extension::Mylyn;
+use strict;
+
+use constant NAME => 'Mylyn';
+
+use constant REQUIRED_MODULES => [
+ {
+ package => 'Data-Dumper',
+ module => 'Data::Dumper',
+ version => 0,
+ },
+];
+
+use constant OPTIONAL_MODULES => [
+];
+
+__PACKAGE__->NAME; \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/lib/Util.pm b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/lib/Util.pm
new file mode 100644
index 000000000..f8f174a60
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/extensions/Mylyn/lib/Util.pm
@@ -0,0 +1,25 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2012 Frank Becker and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Frank Becker - initial API and implementation
+#
+
+package Bugzilla::Extension::Mylyn::Util;
+use strict;
+use base qw(Exporter);
+our @EXPORT = qw(
+
+);
+
+# This file can be loaded by your extension via
+# "use Bugzilla::Extension::Mylyn::Util". You can put functions
+# used by your extension in here. (Make sure you also list them in
+# @EXPORT.)
+
+1; \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/index.php b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/index.php
new file mode 100644
index 000000000..bd7699fd7
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/files/index.php
@@ -0,0 +1,3 @@
+<?php
+echo "THIS PAGE IS MANAGED BY PUPPET !!!";
+?>
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
new file mode 100644
index 000000000..6a8a00fed
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/defaultsites.pp
@@ -0,0 +1,144 @@
+define bugzilla::defaultsites {
+$requirements = [
+ "apache2",
+ "apache2.2-common",
+ "libapache2-mod-auth-mysql",
+ "libapache2-mod-fcgid",
+ "libapache2-mod-php5",
+ "mysql-server",
+ "bzr",
+ "make",
+ "perl-doc",
+ "php5",
+ "php5-mysql",
+ "phpmyadmin",
+ "libcgi-pm-perl",
+ "libdbd-mysql-perl",
+ "libdatetime-perl",
+ "libdatetime-timezone-perl",
+ "libemail-mime-perl",
+ "libemail-send-perl",
+ "libjson-rpc-perl",
+ "libmail-sendmail-perl",
+ "libmath-random-isaac-perl",
+ "libtest-taint-perl",
+ "liburi-perl",
+ "libsoap-lite-perl",
+ "libtemplate-perl",
+]
+
+ package { $requirements:
+ ensure => "installed" ,
+ require => Exec["apt-get update"],
+ }
+
+ exec { "Enable php5 module":
+ command => "a2enmod php5",
+ require => Package["libapache2-mod-php5"],
+ creates => "/etc/apache2/mods-enabled/php5.load",
+ }
+
+ service { "apache2":
+ ensure => running,
+ require => Package["apache2"],
+ }
+
+ exec { "Enable auth_digest module":
+ command => "a2enmod auth_digest",
+ require => Package["apache2"],
+ creates => "/etc/apache2/mods-enabled/auth_digest.load",
+ }
+
+ exec { "Enable fcgid module":
+ command => "a2enmod fcgid",
+ require => Package["libapache2-mod-fcgid"],
+ creates => "/etc/apache2/mods-enabled/fcgid.load",
+ }
+
+ exec { "Enable proxy mod":
+ command => "a2enmod proxy",
+ require => Package["apache2"],
+ creates => "/etc/apache2/mods-enabled/proxy.load",
+ }
+
+ exec { "Enable proxy_http mod":
+ command => "a2enmod proxy_http",
+ require => Package["apache2"],
+ creates => "/etc/apache2/mods-enabled/proxy_http.load",
+ }
+
+ exec { "Enable ssl module":
+ command => "a2enmod ssl",
+ require => Package["apache2"],
+ creates => "/etc/apache2/mods-enabled/ssl.load",
+ }
+
+ service { "mysql":
+ ensure => "running",
+ enable => "true",
+ require => Package["mysql-server"],
+ }
+
+ exec { "phpmyadmin_Apache2":
+ command => "echo '#phpmyadmin\nInclude /etc/phpmyadmin/apache.conf' >>/etc/apache2/apache2.conf",
+ require => [Package["phpmyadmin"],Package["libapache2-mod-php5"]],
+ unless => 'cat /etc/apache2/apache2.conf | grep "#phpmyadmin"'
+ }
+
+ file { "/etc/apache2/sites-enabled/001-default-ssl":
+ ensure => link,
+ target => "/etc/apache2/sites-available/default-ssl",
+ }
+
+ exec { "create $bugzilla::toolsDir":
+ command => "mkdir $bugzilla::toolsDir",
+ creates => "$bugzilla::toolsDir",
+ require => Exec['phpmyadmin_Apache2']
+ }
+
+ exec { "create $bugzilla::bugzillaBase":
+ command => "mkdir $bugzilla::bugzillaBase",
+ creates => "$bugzilla::bugzillaBase",
+ require => Exec["create $bugzilla::toolsDir"]
+ }
+
+ exec { "create $bugzilla::installHelper":
+ command => "mkdir $bugzilla::installHelper",
+ creates => "$bugzilla::installHelper",
+ require => Exec[ "create $bugzilla::bugzillaBase"]
+ }
+
+ exec { "create $bugzilla::confDir":
+ command => "mkdir $bugzilla::confDir",
+ creates => "$bugzilla::confDir",
+ require => Exec[ "create $bugzilla::bugzillaBase"]
+ }
+
+ exec { "create $bugzilla::installLog":
+ command => "mkdir $bugzilla::installLog",
+ creates => "$bugzilla::installLog",
+ require => Exec[ "create $bugzilla::bugzillaBase"]
+ }
+
+ exec { "mysql-create-user-${bugzilla::dbuser}" :
+ unless => "/usr/bin/mysql --user='${bugzilla::dbuser}' --password='${bugzilla::dbuserPassword}'",
+ command => "/usr/bin/mysql -v --user='root' -e \"CREATE USER '${bugzilla::dbuser}'@localhost IDENTIFIED BY '${bugzilla::dbuserPassword}'\"",
+ logoutput => true,
+ require => [ Package["mysql-server"],
+ Exec["create $bugzilla::installHelper"],
+ Exec["create $bugzilla::installLog"],
+ Package[$requirements]
+ ]
+ }
+
+ file { "/var/www/index.php":
+ notify => Service["apache2"],
+ ensure => "present",
+ source => "puppet:///modules/bugzilla/index.php",
+ owner => "root",
+ group => "root",
+ mode => 644,
+ require => [Package["apache2"], Package["php5"]],
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp
new file mode 100644
index 000000000..7770563ab
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/manifests/init.pp
@@ -0,0 +1,113 @@
+define bugzillaVersion(
+ $major,
+ $minor,
+ $www_url = "$title",
+ $version = "$title",
+ $branch = "${major}.${minor}",
+ $branchTag = "bugzilla-stable",
+ $bugz_dbname = "bugs_${major}_${minor}",
+ $custom_wf = false,
+ $custom_wf_and_status = false,
+ $xmlrpc_enabled = true,
+ $base = "/home/tools/bugzilla"
+) {
+ if $major == "3" {
+ if $minor == "6" {
+ $VersionCreateName = "name"
+ } else {
+ $VersionCreateName = "value"
+ }
+ } else {
+ $VersionCreateName = "value"
+ }
+
+ if $branchTag == "trunk" {
+ exec { "extract bugzilla $version":
+ command => "bzr co bzr://bzr.mozilla.org/bugzilla/$branch $version",
+ cwd => "$base",
+ timeout => 300,
+ creates => "$base/$version",
+ }
+ } else {
+ exec { "extract bugzilla $version":
+ command => "bzr co -r tag:$branchTag bzr://bzr.mozilla.org/bugzilla/$branch $version",
+ cwd => "$base",
+ timeout => 300,
+ creates => "$base/$version",
+ }
+ }
+
+ exec { "mysql-grant-${bugz_dbname}-${bugzilla::dbuser}" :
+ unless => "/usr/bin/mysql --user=root --batch -e \"SELECT user FROM db WHERE Host='localhost' and Db='${bugz_dbname}' and User='${bugzilla::dbuser}'\" mysql | /bin/grep '${bugzilla::dbuser}'",
+ command => "/usr/bin/mysql --verbose --user=root -e \"GRANT ALL ON ${bugz_dbname}.* TO '${bugzilla::dbuser}'@localhost\" \
+ ; /usr/bin/mysqladmin --verbose --user=root flush-privileges",
+ logoutput => true,
+ require => Exec["extract bugzilla $version"]
+ }
+
+ exec { "mysql-dropdb-$version" :
+ onlyif => "/usr/bin/mysql --user=root '${bugz_dbname}'",
+ command => "/usr/bin/mysqladmin -v --user=root --force drop '${bugz_dbname}'",
+ logoutput => true,
+ require => Exec["mysql-grant-${bugz_dbname}-${bugzilla::dbuser}"]
+ }
+
+ exec { "mysql-createdb-$version" :
+ unless => "/usr/bin/mysql --user=root '${bugz_dbname}'",
+ command => "/usr/bin/mysqladmin -v --user=root --force create '${bugz_dbname}'",
+ logoutput => true,
+ require => Exec["mysql-dropdb-$version"]
+ }
+
+ file { "$bugzilla::installHelper/answers$version":
+ content => template('bugzilla/answers.erb'),
+ require => Exec["extract bugzilla $version"],
+ }
+
+ file { "$base/$version/extensions/Mylyn":
+ ensure => directory, # so make this a directory
+ recurse => true, # enable recursive directory management
+ purge => true, # purge all unmanaged junk
+ force => true, # also purge subdirs and links etc.
+ owner => "root",
+ group => "root",
+ source => "puppet:///modules/bugzilla/extensions/Mylyn",
+ require => Exec["extract bugzilla $version"],
+ }
+
+ file { "$base/$version/extensions/Mylyn/Extension.pm":
+ content => template('bugzilla/Extension.pm.erb'),
+ require => FILE["$base/$version/extensions/Mylyn"],
+ mode => 0644,
+ }
+
+ exec { "init bugzilla_checksetup $version":
+ command => "$base/$version/checksetup.pl $bugzilla::installHelper/answers$version -verbose",
+ cwd => "$base/$version" ,
+ creates => "$base/$version/localconfig",
+ require => [EXEC ["mysql-createdb-$version"], File["$bugzilla::installHelper/answers$version"], FILE["$base/$version/extensions/Mylyn/Extension.pm"]]
+ }
+
+ exec { "update bugzilla_checksetup $version":
+ command => "$base/$version/checksetup.pl $bugzilla::installHelper/answers$version -verbose",
+ cwd => "$base/$version" ,
+ logoutput => true,
+ require => [EXEC ["mysql-createdb-$version"], EXEC["init bugzilla_checksetup $version"], File["$bugzilla::installHelper/answers$version"], FILE["$base/$version/extensions/Mylyn/Extension.pm"]]
+ }
+
+ if !$xmlrpc_enabled {
+ file { "$base/$version/xmlrpc.cgi":
+ content => template('bugzilla/xmlrpc.cgi.erb'),
+ mode => 755,
+ require => Exec["update bugzilla_checksetup $version"],
+ }
+ }
+
+ file { "$bugzilla::confDir/$version.conf":
+ content => template('bugzilla/apache2.conf.erb'),
+ require => [Package["apache2"], EXEC["update bugzilla_checksetup $version"]],
+ notify => Service["apache2"],
+ }
+
+
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
new file mode 100644
index 000000000..529f2f4ea
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/Extension.pm.erb
@@ -0,0 +1,448 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2012 Frank Becker and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Frank Becker - initial API and implementation
+#
+
+package Bugzilla::Extension::Mylyn;
+use strict;
+use base qw(Bugzilla::Extension);
+
+# This code for this is in ./extensions/Mylyn/lib/Util.pm
+use Bugzilla::Extension::Mylyn::Util;
+
+use Bugzilla::Constants;
+use Bugzilla::Error;
+use Bugzilla::Product;
+use Bugzilla::FlagType;
+
+use Data::Dumper;
+
+our $VERSION = '0.01';
+
+<% if @custom_wf %>
+use constant STATUS_WORKFLOW => (
+ ['REOPENED','UNCONFIRMED'],
+ ['REOPENED','VERIFIED'],
+ ['REOPENED','CLOSED'],
+ ['NEW','CLOSED'],
+);
+use constant STATUS_WORKFLOW_DELETE => (
+ ['CLOSED','UNCONFIRMED'],
+ ['CLOSED','REOPENED'],
+ ['ASSIGNED','NEW'],
+);
+<% end %>
+<% if @custom_wf_and_status %>
+use constant STATUS_WORKFLOW => (
+ ['VERIFIED','MODIFIED'],
+ ['ON_DEV','POST'],
+ ['MODIFIED','ON_DEV'],
+ ['CLOSED','VERIFIED'],
+ ['NEW','UNCONFIRMED'],
+);
+use constant STATUS_WORKFLOW_DELETE => (
+ ['UNCONFIRMED','ASSIGNED'],
+ ['RESOLVED','UNCONFIRMED'],
+ ['VERIFIED','UNCONFIRMED'],
+ ['CLOSED','UNCONFIRMED'],
+ ['ASSIGNED','NEW'],
+ ['REOPENED','NEW'],
+ ['REOPENED','ASSIGNED'],
+ ['RESOLVED','REOPENED'],
+ ['VERIFIED','REOPENED'],
+ ['CLOSED','REOPENED'],
+ ['UNCONFIRMED','RESOLVED'],
+ ['NEW','RESOLVED'],
+ ['ASSIGNED','RESOLVED'],
+ ['REOPENED','RESOLVED'],
+ ['RESOLVED','VERIFIED'],
+
+);
+<% end %>
+
+sub install_before_final_checks {
+ my ($self, $args) = @_;
+ print "Mylyn Extension: install-before_final_checks hook\n" unless $args->{silent};
+
+ my $dbh = Bugzilla->dbh;
+ if (!$dbh->selectrow_array('SELECT 1 FROM profiles where userid > 1')) {
+ print "create additional profiles...\n" unless $args->{silent};
+
+ # create tests@mylyn.eclipse.org
+ # add this user to group bz_canusewhineatothers
+ my $testu = Bugzilla::User->create({ login_name => 'tests@mylyn.eclipse.org',
+ realname => 'Mylyn Test',
+ cryptpassword => 'mylyntest' });
+ my $private_group = new Bugzilla::Group({name => 'bz_canusewhineatothers'});
+ my $sth = $dbh->prepare( "INSERT INTO user_group_map
+ (user_id, group_id, isbless, grant_type)
+ VALUES (?, ?, ?, ?)");
+ $sth->execute($testu->id, $private_group->id, 0, GRANT_DIRECT);
+
+ # create guest@mylyn.eclipse.org
+ Bugzilla::User->create({ login_name => 'guest@mylyn.eclipse.org',
+ realname => 'Mylyn guest',
+ cryptpassword => 'mylyntest' });
+ }
+
+ # create two new products
+ if (!$dbh->selectrow_array('SELECT 1 FROM products where id > 1')) {
+ print "create additional products...\n" unless $args->{silent};
+
+ # Get the user who will be the owner of the Component.
+ # We pick the tests@mylyn.eclipse.org, which is the
+ # user Extension.pl just created.
+
+ my ($testuser_id) = $dbh->selectrow_array(
+ 'SELECT userid FROM profiles WHERE login_name = ? ' ,
+ undef, 'tests@mylyn.eclipse.org');
+ my $testuser = Bugzilla::User->new($testuser_id);
+
+ my $product2 = Bugzilla::Product->create({
+ name => 'Product with Spaces',
+ description => 'Product with Spaces is the renamed Scratch Product.',
+ version => Bugzilla::Version::DEFAULT_VERSION,
+ classification => 'Unclassified',
+ defaultmilestone => DEFAULT_MILESTONE,
+ });
+ Bugzilla::Component->create({ %{ ({
+ name => 'Component 1',
+ description => '1'
+ }) },
+ product => $product2,
+ initialowner => $testuser->login });
+ Bugzilla::Component->create({ %{ ({
+ name => 'Component 2',
+ description => '2'
+ }) },
+ product => $product2,
+ initialowner => $testuser->login });
+
+ Bugzilla::Version->create({ <%= @VersionCreateName %> => 'a', product => $product2 });
+ Bugzilla::Version->create({ <%= @VersionCreateName %> => 'b', product => $product2 });
+ Bugzilla::Version->create({ <%= @VersionCreateName %> => 'c', product => $product2 });
+ Bugzilla::Milestone->create({ <%= @VersionCreateName %> => 'M1.0', product => $product2 });
+ Bugzilla::Milestone->create({ <%= @VersionCreateName %> => 'M2.0', product => $product2 });
+ Bugzilla::Milestone->create({ <%= @VersionCreateName %> => 'M3.0', product => $product2 });
+
+ my $product3 = Bugzilla::Product->create({
+ name => 'ManualTest',
+ description => 'Product for manual testing',
+ version => Bugzilla::Version::DEFAULT_VERSION,
+ classification => 'Unclassified',
+ defaultmilestone => DEFAULT_MILESTONE,
+ });
+ Bugzilla::Component->create({ %{ ({
+ name => 'ManualC1',
+ description => '1'
+ }) },
+ product => $product3,
+ initialowner => $testuser->login });
+ Bugzilla::Component->create({ %{ ({
+ name => 'ManualC2',
+ description => '2'
+ }) },
+ product => $product3,
+ initialowner => $testuser->login });
+
+ Bugzilla::Version->create({ <%= @VersionCreateName %> => 'R1', product => $product3 });
+ Bugzilla::Version->create({ <%= @VersionCreateName %> => 'R1.1', product => $product3 });
+ Bugzilla::Version->create({ <%= @VersionCreateName %> => 'R2.0', product => $product3 });
+ Bugzilla::Milestone->create({ <%= @VersionCreateName %> => 'M1', product => $product3 });
+ Bugzilla::Milestone->create({ <%= @VersionCreateName %> => 'M2', product => $product3 });
+ Bugzilla::Milestone->create({ <%= @VersionCreateName %> => 'M3', product => $product3 });
+ }
+
+ # create the needed custon fields
+ if (!$dbh->selectrow_array('SELECT 1 FROM fielddefs where name like "cf_%"')) {
+ print "create additional fielddefs...\n" unless $args->{silent};
+ Bugzilla::Field->create({ %{ ({
+ description => 'free text custom field',
+ type => 1,
+ sortkey => 351,
+ mailhead => 1,
+ enter_bug => 1,
+ obsolete => 0,
+ buglist => 1,
+ }) },
+ name => 'cf_freetext', custom => 1
+ });
+ Bugzilla::Field->create({ %{ ({
+ description => 'drop down custom field',
+ type => 2,
+ sortkey => 451,
+ mailhead => 1,
+ enter_bug => 1,
+ obsolete => 0,
+ buglist => 1,
+ }) },
+ name => 'cf_dropdown', custom => 1
+ });
+
+ # create the options for cf_dropdown
+ Bugzilla::Field::Choice->type('cf_dropdown')->create({
+ value => 'one',
+ sortkey => 0,
+ is_open => 1,
+ });
+ Bugzilla::Field::Choice->type('cf_dropdown')->create({
+ value => 'two',
+ sortkey => 0,
+ is_open => 1,
+ });
+ Bugzilla::Field::Choice->type('cf_dropdown')->create({
+ value => 'three',
+ sortkey => 0,
+ is_open => 1,
+ });
+
+ Bugzilla::Field->create({ %{ ({
+ description => 'large text box custom field',
+ type => 4,
+ sortkey => 551,
+ mailhead => 1,
+ enter_bug => 1,
+ obsolete => 0,
+ buglist => 1,
+ }) },
+ name => 'cf_largetextbox', custom => 1
+ });
+ Bugzilla::Field->create({ %{ ({
+ description => 'multi selection box custom field',
+ type => 3,
+ sortkey => 651,
+ mailhead => 1,
+ enter_bug => 1,
+ obsolete => 0,
+ buglist => 1,
+ }) },
+ name => 'cf_multiselect', custom => 1
+ });
+
+ # create the options for cf_multiselect
+ Bugzilla::Field::Choice->type('cf_multiselect')->create({
+ value => 'Blue',
+ sortkey => 0,
+ is_open => 1,
+ });
+ Bugzilla::Field::Choice->type('cf_multiselect')->create({
+ value => 'Green',
+ sortkey => 0,
+ is_open => 1,
+ });
+ Bugzilla::Field::Choice->type('cf_multiselect')->create({
+ value => 'Red',
+ sortkey => 0,
+ is_open => 1,
+ });
+ Bugzilla::Field::Choice->type('cf_multiselect')->create({
+ value => 'Yellow',
+ sortkey => 0,
+ is_open => 1,
+ });
+
+ Bugzilla::Field->create({ %{ ({
+ description => 'date time custom field',
+ type => 5,
+ sortkey => 751,
+ mailhead => 1,
+ enter_bug => 1,
+ obsolete => 0,
+ buglist => 1,
+ }) },
+ name => 'cf_datetime', custom => 1
+ });
+ Bugzilla::Field->create({ %{ ({
+ description => 'bug id custom field',
+ type => 6,
+ sortkey => 851,
+ mailhead => 1,
+ enter_bug => 1,
+ obsolete => 0,
+ buglist => 1,
+ }) },
+ name => 'cf_bugid', custom => 1
+ });
+ }
+# if (!$dbh->selectrow_array('SELECT 1 FROM bug_status where value = "test"')) {
+# print "Anlegen von Status!!!!\n" unless $args->{silent};
+# Bugzilla::Status->create({ value => 'test', is_open => 0 });
+# }
+
+ if (!$dbh->selectrow_array('SELECT 1 FROM flagtypes')) {
+ print "create additional flagtypes...\n" unless $args->{silent};
+ my $flagtype = Bugzilla::FlagType->insert_create_data({
+ name => 'BugFlag1',
+ description => '1',
+ target_type => 'bug',
+ cc_list => '',
+ sortkey => 1,
+ is_active => 1,
+ is_requestable => 0,
+ is_requesteeble => 0,
+ is_multiplicable => 0,
+ });
+ # set the inclusion to __Any__:__Any__
+ my $sth = $dbh->prepare("INSERT INTO flaginclusions
+ (type_id, product_id, component_id) VALUES (?, ?, ?)");
+ $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+
+ $flagtype = Bugzilla::FlagType->insert_create_data({
+ name => 'BugFlag2',
+ description => '2',
+ target_type => 'bug',
+ cc_list => '',
+ sortkey => 1,
+ is_active => 1,
+ is_requestable => 1,
+ is_requesteeble => 0,
+ is_multiplicable => 0,
+ });
+ # set the inclusion to __Any__:__Any__
+ $sth = $dbh->prepare("INSERT INTO flaginclusions
+ (type_id, product_id, component_id) VALUES (?, ?, ?)");
+ $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+
+ $flagtype = Bugzilla::FlagType->insert_create_data({
+ name => 'AttachmentFlag1',
+ description => '1',
+ target_type => 'attachment',
+ cc_list => '',
+ sortkey => 1,
+ is_active => 1,
+ is_requestable => 1,
+ is_requesteeble => 1,
+ is_multiplicable => 1,
+ });
+ # set the inclusion to __Any__:__Any__
+ $sth = $dbh->prepare("INSERT INTO flaginclusions
+ (type_id, product_id, component_id) VALUES (?, ?, ?)");
+ $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+
+ $flagtype = Bugzilla::FlagType->insert_create_data({
+ name => 'AttachmentFlag2',
+ description => '2',
+ target_type => 'attachment',
+ cc_list => '',
+ sortkey => 1,
+ is_active => 1,
+ is_requestable => 1,
+ is_requesteeble => 1,
+ is_multiplicable => 1,
+ });
+ # set the inclusion to __Any__:__Any__
+ $sth = $dbh->prepare("INSERT INTO flaginclusions
+ (type_id, product_id, component_id) VALUES (?, ?, ?)");
+ $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+
+ $flagtype = Bugzilla::FlagType->insert_create_data({
+ name => 'BugFlag3',
+ description => '3',
+ target_type => 'bug',
+ cc_list => '',
+ sortkey => 1,
+ is_active => 1,
+ is_requestable => 1,
+ is_requesteeble => 0,
+ is_multiplicable => 1,
+ });
+ # set the inclusion to __Any__:__Any__
+ $sth = $dbh->prepare("INSERT INTO flaginclusions
+ (type_id, product_id, component_id) VALUES (?, ?, ?)");
+ $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+
+ $flagtype = Bugzilla::FlagType->insert_create_data({
+ name => 'BugFlag4',
+ description => '4',
+ target_type => 'bug',
+ cc_list => '',
+ sortkey => 1,
+ is_active => 1,
+ is_requestable => 1,
+ is_requesteeble => 1,
+ is_multiplicable => 1,
+ });
+ # set the inclusion to __Any__:__Any__
+ $sth = $dbh->prepare("INSERT INTO flaginclusions
+ (type_id, product_id, component_id) VALUES (?, ?, ?)");
+ $sth->execute(bless($flagtype,, 'Bugzilla::FlagType' )->id, undef, undef);
+ }
+
+ if (!$dbh->selectrow_array('SELECT 1 FROM keyworddefs')) {
+ print "create additional keyworddefs...\n" unless $args->{silent};
+ Bugzilla::Keyword->create({ name => 'Keyword1', description => '1' });
+ Bugzilla::Keyword->create({ name => 'Keyword2', description => '2' });
+ }
+<% if @custom_wf %>
+ my %status_ids = @{ $dbh->selectcol_arrayref(
+ 'SELECT value, id FROM bug_status', {Columns=>[1,2]}) };
+ my $old_id = $status_ids{'REOPENED'};
+ my $new_id = $status_ids{'UNCONFIRMED'};
+ if (!$dbh->selectrow_array('SELECT 1 FROM status_workflow where old_status ='. $old_id . ' and new_status ='.$new_id)) {
+ print "create additional status_workflow...\n" unless $args->{silent};
+ my $sth_insert = $dbh->prepare('INSERT INTO status_workflow (old_status, new_status)
+ VALUES (?, ?)');
+ my $sth_delete = $dbh->prepare('DELETE FROM status_workflow
+ WHERE old_status = ? AND new_status = ?');
+
+ foreach my $pair (STATUS_WORKFLOW) {
+ my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef;
+ my $new_id = $status_ids{$pair->[1]};
+ $sth_insert->execute($old_id, $new_id);
+ }
+ foreach my $pair (STATUS_WORKFLOW_DELETE) {
+ my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef;
+ my $new_id = $status_ids{$pair->[1]};
+ $sth_delete->execute($old_id, $new_id);
+ }
+ }
+<% end %>
+<% if @custom_wf_and_status %>
+ if (!$dbh->selectrow_array('SELECT 1 FROM bug_status where value = "ON_DEV"')) {
+ print "Anlegen von Status!!!!\n" unless $args->{silent};
+ Bugzilla::Status->create({ value => 'ON_DEV', is_open => 1 , sortkey => 800});
+ Bugzilla::Status->create({ value => 'POST', is_open => 0 , sortkey => 900});
+ Bugzilla::Status->create({ value => 'MODIFIED', is_open => 1 , sortkey => 1200});
+ }
+ my %status_ids = @{ $dbh->selectcol_arrayref(
+ 'SELECT value, id FROM bug_status', {Columns=>[1,2]}) };
+ my $old_id = $status_ids{'REOPENED'};
+ my $new_id = $status_ids{'UNCONFIRMED'};
+ if (!$dbh->selectrow_array('SELECT 1 FROM status_workflow where old_status ='. $old_id . ' and new_status ='.$new_id)) {
+ print "create additional status_workflow...\n" unless $args->{silent};
+ my $sth_insert = $dbh->prepare('INSERT INTO status_workflow (old_status, new_status)
+ VALUES (?, ?)');
+ my $sth_delete = $dbh->prepare('DELETE FROM status_workflow
+ WHERE old_status = ? AND new_status = ?');
+ my $sth_delnul = $dbh->prepare('DELETE FROM status_workflow
+ WHERE old_status IS NULL AND new_status = ?');
+
+print "before insert";
+ foreach my $pair (STATUS_WORKFLOW) {
+ my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef;
+ my $new_id = $status_ids{$pair->[1]};
+ $sth_insert->execute($old_id, $new_id);
+ }
+print "before delete";
+ foreach my $pair (STATUS_WORKFLOW_DELETE) {
+ my $old_id = $pair->[0] ? $status_ids{$pair->[0]} : undef;
+ my $new_id = $status_ids{$pair->[1]};
+ $sth_delete->execute($old_id, $new_id);
+ }
+print "before delete null";
+ my $new_id = $status_ids{'ASSIGNED'};
+ $sth_delnul->execute($new_id);
+ }
+<% end %>
+
+ print "Mylyn Extension: end of install-before_final_checks hook\n" unless $args->{silent};
+}
+
+__PACKAGE__->NAME;
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb
new file mode 100644
index 000000000..50a6b109e
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/answers.erb
@@ -0,0 +1,18 @@
+$answer{'webservergroup'} = '';
+$answer{'db_host'} = 'localhost';
+$answer{'db_driver'} = 'mysql';
+$answer{'db_port'} = 0;
+$answer{'db_name'} = '<%= @bugz_dbname %>';
+$answer{'db_user'} = '<%= @dbuser %>';
+$answer{'db_pass'} = '<%= @dbuserPassword %>';
+$answer{'urlbase'} = '';
+$answer{'ADMIN_OK'} = 'Y';
+$answer{'ADMIN_EMAIL'} = 'admin@mylyn.eclipse.org';
+$answer{'ADMIN_PASSWORD'} = 'main4Afo';
+$answer{'ADMIN_REALNAME'} = 'Mylyn Admin';
+$answer{'SMTP_SERVER'} = '';
+$answer{'usetargetmilestone'} = '1';
+$answer{'mail_delivery_method'} = 'None';
+$answer{'insidergroup'} = 'bz_canusewhineatothers';
+<% if @custom_wf_and_status %>$answer{'duplicate_or_move_bug_status'} = 'CLOSED';<% end %>
+$answer{'NO_PAUSE'} = 1
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/apache2.conf.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/apache2.conf.erb
new file mode 100644
index 000000000..7633f8ee5
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/apache2.conf.erb
@@ -0,0 +1,9 @@
+Alias /<%= @www_url %> <%= @base %>/<%= @version %>
+<Directory <%= @base %>/<%= @version %>>
+ AddHandler cgi-script .cgi
+ Options +Indexes +ExecCGI
+ DirectoryIndex index.cgi
+ AllowOverride None
+ Order allow,deny
+ Allow from all
+</Directory>
diff --git a/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/xmlrpc.cgi.erb b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/xmlrpc.cgi.erb
new file mode 100644
index 000000000..50a0c5412
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.releng/modules/bugzilla/templates/xmlrpc.cgi.erb
@@ -0,0 +1,12 @@
+#!/usr/bin/perl -wT
+
+use strict;
+use lib qw(. lib);
+
+use Bugzilla;
+use Bugzilla::Constants;
+use Bugzilla::Error;
+use Bugzilla::WebService::Constants;
+BEGIN {
+ ThrowCodeError('feature_disabled', { feature => 'xmlrpc' });
+}

Back to the top