head	1.11;
access;
symbols
	TIGRIS_1_1_0RC2:1.10
	TIGRIS_1_1_0RC1:1.10
	TIGRIS_1_1:1.10.0.4
	TIGRIS_1_0_8:1.10
	TIGRIS_1_0_8RC3:1.10
	TIGRIS_1_0_8RC2:1.10
	TIGRIS_1_0_8RC1:1.10
	TIGRIS_1_0_7:1.10
	TIGRIS_1_0_7RC3:1.10
	TIGRIS_1_0_7RC2:1.10
	TIGRIS_1_0_7RC1:1.10
	TIGRIS_1_0_6:1.10
	TIGRIS_1_0_6RC5:1.10
	TIGRIS_1_0_6RC4:1.10
	TIGRIS_1_0_6RC3:1.10
	TIGRIS_1_0_6RC2:1.10
	TIGRIS_1_0_6RC1:1.10
	TIGRIS_1_0_5:1.10
	TIGRIS_1_0_5RC6:1.10
	TIGRIS_1_0_5RC5:1.10
	TIGRIS_1_0_5RC4:1.10
	TIGRIS_1_0_5RC3:1.10
	TIGRIS_1_0_5RC2:1.10
	TIGRIS_1_0_5RC1:1.10
	TIGRIS_1_0_4:1.10
	TIGRIS_1_0_3:1.10
	TIGRIS_1_0_2:1.10
	TIGRIS_1_0_1:1.10
	TIGRIS_1_0:1.10.0.6
	TIGRIS_1_0_0:1.10
	TIGRIS_1_0_0_RC1:1.10.0.2
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.8.2.1
	TIGRIS_0_9_2_3:1.8.2.1
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.8
	TIGRIS_0_9_2_1:1.8
	TIGRIS_0_9_2:1.8.0.2
	TIGRIS_0_9_0:1.3.0.2
	TIGRIS_0_8_4:1.2.0.2;
locks; strict;
comment	@# @;


1.11
date	2001.03.30.00.23.16;	author kmaples;	state dead;
branches;
next	1.10;

1.10
date	2001.02.21.01.56.41;	author edk;	state Exp;
branches;
next	1.9;

1.9
date	2001.02.05.19.44.25;	author kmaples;	state dead;
branches;
next	1.8;

1.8
date	2001.01.19.06.13.24;	author jrobbins;	state Exp;
branches
	1.8.2.1;
next	1.7;

1.7
date	2001.01.18.21.57.46;	author kmaples;	state dead;
branches;
next	1.6;

1.6
date	2001.01.18.21.47.13;	author kmaples;	state Exp;
branches;
next	1.5;

1.5
date	2001.01.16.07.10.02;	author kmaples;	state Exp;
branches;
next	1.4;

1.4
date	2001.01.16.06.58.37;	author kmaples;	state Exp;
branches;
next	1.3;

1.3
date	2000.12.20.20.43.57;	author kmaples;	state Exp;
branches;
next	1.2;

1.2
date	2000.11.17.17.54.13;	author kmaples;	state Exp;
branches;
next	1.1;

1.1
date	2000.11.17.00.37.43;	author kmaples;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.02.21.00.36.24;	author dlr;	state Exp;
branches;
next	;

1.8.2.1
date	2001.01.19.06.16.44;	author jrobbins;	state Exp;
branches;
next	;


desc
@@


1.11
log
@Depricated; the same thing is accomplished by a bootstrap task put into
the taskrunner at install time.
@
text
@#!/usr/bin/perl
# $Id: populate_issue_dbs,v 1.10 2001/02/21 01:56:41 edk Exp $ 
# Script to setup Issuezilla for projects in the helm database
# at install time.  This aspires to complete the project creation
# process as it would be if the initial projects had been created
# via servlet 

use DBI;

# Stuff grabbed from env.sh:

my $DB    = $ENV{DATABASE_NAME};
my $DBPW  = $ENV{DATABASE_ADMIN_PASSWORD};
my $DBUSR = $ENV{DATABASE_ADMIN_USER};

# Location of the helper scripts:
my $SCPTBASE = $ENV{SANDBOX} . '/helm/perl/scripts';

my $dbc = "DBI:mysql:$DB";
my $CONN = DBI->connect($dbc, $DBUSR, $DBPW);

print "Checking for projects in $DB:\n";

my $statement = qq{ 
  SELECT
    HELM_DOMAIN.NAME,  HELM_PROJECT.NAME,  HELM_PROJECT.PROJECT_ID,
    HELM_PROJECT.SHORT_DESCRIPTION 
  FROM 
    HELM_PROJECT , HELM_DOMAIN
  WHERE 
    HELM_PROJECT.TYPE = 'base'
  AND 
    HELM_PROJECT.DOMAIN_ID = HELM_DOMAIN.DOMAIN_ID
};

my $select = $CONN->prepare($statement);
my $ret    = $select->execute;

while(my (@@record) = $select->fetchrow_array){

    my ($domain_name, $project_name, $project_id, $description) = @@record;	

    print "  Adding for ($domain_name, $project_name, $project_id, $description)\n";   

    # This is rough, and in the last two cases, has hard-coded info
    # that needs to be derived from elsewhere. 

    print qq{($domain_name, $project_name, $project_id, $description)\n};
    
    # Your best bet here is to call system in the list form - the shell doesn't 
    # particularly care for line escapes:
  
    system("$SCPTBASE/ProjectAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--description='$description'");

    system("$SCPTBASE/MemberAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--issues_realname='Tigris SuperUser'", "--issues_username=root",
        "--issues_role=admin");

    system("$SCPTBASE/ModuleAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--module_name=www", "--module_description='Web content'", 
        "--is_web=1");


}

print "Finished adding projects.\n"; 

$select->finish();
$CONN->disconnect;



@


1.10
log
@add new files from the branch to the head (there should be only added
files, ie. no modified files).
@
text
@d2 1
a2 1
# $Id: populate_issue_dbs,v 1.1.1.1 2001/02/21 00:36:24 dlr Exp $ 
@


1.9
log
@
The purpose that this script fulfilled - bootstrapping issues databases and
user accounts from the Helm Users table - has been superceeded by a special
task inserted at installation (sql insert can be found at
helm/sql/org/tigris/helm/populate_Task.sql)
@
text
@d2 1
a2 1
# $Id: populate_issue_dbs,v 1.8 2001/01/19 06:13:24 jrobbins Exp $ 
@


1.8
log
@ added back working version
@
text
@d2 1
a2 1
# $Id: populate_issue_dbs,v 1.3 2000/12/20 20:43:57 kmaples Exp $ 
@


1.8.2.1
log
@ added back working version
@
text
@d2 1
a2 1
# $Id: populate_issue_dbs,v 1.8 2001/01/19 06:13:24 jrobbins Exp $ 
@


1.7
log
@Superceeded by sql script
@
text
@d1 2
a2 2
#!/usr/bin/perl -w 
# $Id: populate_issue_dbs,v 1.6 2001/01/18 21:47:13 kmaples Exp $ 
a8 1
use strict;
d22 1
a22 1
print "Inserting task for TaskRunner\n";
d24 1
a24 3
my $statement = qq{
  INSERT INTO HELM_TASK 
    (COMPONENT, COMMAND, ON_BEHALF_OF, AFFECTED_OBJECT_ID)
d26 8
a33 5
    'Helm', 'Initialize Project Resources',
    User.userID, HELM_PROJECT.PROJECT_ID
  FROM User, HELM_PROJECT
  WHERE User.loginID='root'
  AND HELM_PROJECT.name='**All projects on host'
d39 29
a67 38
## For posterity - previous method of populating the issues db:
 
#print "Checking for projects in $DB:\n";
#
#my $statement = qq{ 
#  SELECT
#    HELM_DOMAIN.NAME,  HELM_PROJECT.NAME,  HELM_PROJECT.PROJECT_ID,
#    HELM_PROJECT.SHORT_DESCRIPTION 
#  FROM 
#    HELM_PROJECT , HELM_DOMAIN
#  WHERE 
#    HELM_PROJECT.TYPE = 'base'
#  AND 
#    HELM_PROJECT.DOMAIN_ID = HELM_DOMAIN.DOMAIN_ID
#};
#
#my $select = $CONN->prepare($statement);
#my $ret    = $select->execute;
#
#while(my (@@record) = $select->fetchrow_array){
#    my ($domain_name, $project_name, $project_id, $description) = @@record;	
#    print "  Adding for ($domain_name, $project_name, $project_id, $description)\n";   
#    # This is rough, and in the last two cases, has hard-coded info
#    # that needs to be derived from elsewhere. 
#    print qq{($domain_name, $project_name, $project_id, $description)\n};
#    # Your best bet here is to call system in the list form - the shell doesn't 
#    # particularly care for line escapes:
#    system("$SCPTBASE/ProjectAdd", "--domain_name=$domain_name", "--project_name=$project_name",
#        "--project_id=$project_id", "--description='$description'");
#    system("$SCPTBASE/MemberAdd", "--domain_name=$domain_name", "--project_name=$project_name",
#        "--project_id=$project_id", "--issues_realname='Tigris SuperUser'", "--issues_username=root",
#        "--issues_role=admin");
#    system("$SCPTBASE/ModuleAdd", "--domain_name=$domain_name", "--project_name=$project_name",
#        "--project_id=$project_id", "--module_name=www", "--module_description='Web content'", 
#        "--is_web=1");
#}
#
#print "Finished adding projects.\n"; 
@


1.6
log
@Changed name of task to run
@
text
@d2 1
a2 1
# $Id: populate_issue_dbs,v 1.5 2001/01/16 07:10:02 kmaples Exp $ 
@


1.5
log
@Forgot ;
@
text
@d2 1
a2 1
# $Id: populate_issue_dbs,v 1.4 2001/01/16 06:58:37 kmaples Exp $ 
d29 1
a29 1
    'Helm', 'Rebuild Issue Tracking',
@


1.4
log
@Now inserts a special task for the taskrunner to begin db rebuilding instead
of trying to read the db.
@
text
@d1 2
a2 2
#!/usr/bin/perl
# $Id: populate_issue_dbs,v 1.3 2000/12/20 20:43:57 kmaples Exp $ 
d9 1
d29 1
a29 1
    "Helm", "Rebuild Issue Tracking",
d32 3
a34 3
  WHERE User.loginID="root"
  AND HELM_PROJECT.name="**All projects on host"
}
@


1.3
log
@I told edk I would, and so I did; the perl project creation scripts now use
posix-style named args.
@
text
@d2 1
a2 1
# $Id: populate_issue_dbs,v 1.2 2000/11/17 17:54:13 kmaples Exp $ 
d22 1
a22 1
print "Checking for projects in $DB:\n";
d24 3
a26 1
my $statement = qq{ 
d28 6
a33 9
    HELM_DOMAIN.NAME,  HELM_PROJECT.NAME,  HELM_PROJECT.PROJECT_ID,
    HELM_PROJECT.SHORT_DESCRIPTION 
  FROM 
    HELM_PROJECT , HELM_DOMAIN
  WHERE 
    HELM_PROJECT.TYPE = 'base'
  AND 
    HELM_PROJECT.DOMAIN_ID = HELM_DOMAIN.DOMAIN_ID
};
d38 38
a75 29
while(my (@@record) = $select->fetchrow_array){

    my ($domain_name, $project_name, $project_id, $description) = @@record;	

    print "  Adding for ($domain_name, $project_name, $project_id, $description)\n";   

    # This is rough, and in the last two cases, has hard-coded info
    # that needs to be derived from elsewhere. 

    print qq{($domain_name, $project_name, $project_id, $description)\n};
    
    # Your best bet here is to call system in the list form - the shell doesn't 
    # particularly care for line escapes:
  
    system("$SCPTBASE/ProjectAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--description='$description'");

    system("$SCPTBASE/MemberAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--issues_realname='Tigris SuperUser'", "--issues_username=root",
        "--issues_role=admin");

    system("$SCPTBASE/ModuleAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--module_name=www", "--module_description='Web content'", 
        "--is_web=1");


}

print "Finished adding projects.\n"; 
@


1.2
log
@Added some comments and explanations.
@
text
@d2 1
a2 1
# $Id: $ 
d50 13
a62 3
    system("$SCPTBASE/ProjectAdd $domain_name $project_name $project_id  NULL '$description' NULL NULL NULL NULL NULL NULL");
    system("$SCPTBASE/MemberAdd  $domain_name $project_name $project_id  NULL NULL NULL NULL NULL 'Tigris SuperUser' root admin");
    system("$SCPTBASE/ModuleAdd  $domain_name $project_name $project_id  NULL NULL www 'Web content' 1 NULL NULL NULL");
@


1.1
log
@First checkin of some rudimentary scripts to perform actions on issuezilla
complimentary to actions performed by populate_repository and create_tigris_database
@
text
@d2 5
d9 3
a12 1
my $DBPFX = $ENV{IZ_DATABASE_NAME};
d16 1
d22 2
d40 1
d42 6
d49 4
a52 3
system("$SCPTBASE/ProjectAdd $domain_name $project_name $project_id  NULL '$description' NULL NULL NULL NULL NULL NULL");
system("$SCPTBASE/MemberAdd  $domain_name $project_name $project_id  NULL NULL NULL NULL NULL 'Tigris SuperUser' root admin");
system("$SCPTBASE/ModuleAdd  $domain_name $project_name $project_id  NULL NULL www 'Web content' 1 NULL NULL NULL");
d56 2
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@a1 5
# $Id: populate_issue_dbs,v 1.8 2001/01/19 06:13:24 jrobbins Exp $ 
# Script to setup Issuezilla for projects in the helm database
# at install time.  This aspires to complete the project creation
# process as it would be if the initial projects had been created
# via servlet 
a3 3

# Stuff grabbed from env.sh:

d5 1
a8 1
# Location of the helper scripts:
a13 2
print "Checking for projects in $DB:\n";

a29 1

a30 6

    print "  Adding for ($domain_name, $project_name, $project_id, $description)\n";   

    # This is rough, and in the last two cases, has hard-coded info
    # that needs to be derived from elsewhere. 

d32 3
a34 14
    
    # Your best bet here is to call system in the list form - the shell doesn't 
    # particularly care for line escapes:
  
    system("$SCPTBASE/ProjectAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--description='$description'");

    system("$SCPTBASE/MemberAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--issues_realname='Tigris SuperUser'", "--issues_username=root",
        "--issues_role=admin");

    system("$SCPTBASE/ModuleAdd", "--domain_name=$domain_name", "--project_name=$project_name",
        "--project_id=$project_id", "--module_name=www", "--module_description='Web content'", 
        "--is_web=1");
a37 2

print "Finished adding projects.\n"; 
@


