|
Last change
on this file since 697 was
696,
checked in by price, 18 years ago
|
|
trac autoinstaller: deploy/bin/trac
|
-
Property svn:executable set to
*
|
|
File size:
1.4 KB
|
| Line | |
|---|
| 1 | #!/usr/bin/perl |
|---|
| 2 | use strict; |
|---|
| 3 | use lib '/mit/scripts/deploy/bin'; |
|---|
| 4 | use onserver; |
|---|
| 5 | use Cwd; |
|---|
| 6 | use File::Path; |
|---|
| 7 | use URI::Escape; |
|---|
| 8 | |
|---|
| 9 | setup(); |
|---|
| 10 | |
|---|
| 11 | print "\nEnter the name of your project (the title of this Trac instance).\n"; |
|---|
| 12 | print "Project name: "; |
|---|
| 13 | my $name=<STDIN>; |
|---|
| 14 | chomp($name); |
|---|
| 15 | |
|---|
| 16 | my $dbstring = "mysql://" . uri_escape($sqluser) . ":" . uri_escape($sqlpass) . "\@$sqlhost/$sqldb"; |
|---|
| 17 | |
|---|
| 18 | print "\nEnter the type of version-control repository this project uses.\n"; |
|---|
| 19 | print "You'll have to set up the repo yourself; feel free to ask scripts@ for help.\n"; |
|---|
| 20 | print "If you don't want version-control integration, take the default.\n"; |
|---|
| 21 | print "Repository type (default svn; also bzr, git, hg): "; |
|---|
| 22 | my $repotype=<STDIN>; |
|---|
| 23 | chomp($repotype); |
|---|
| 24 | $repotype = $repotype ? $repotype : 'svn'; |
|---|
| 25 | |
|---|
| 26 | print "\nEnter the path to the version-control repository.\n"; |
|---|
| 27 | print "If you don't want version-control integration, leave blank.\n"; |
|---|
| 28 | print "Path to repository: "; |
|---|
| 29 | my $repopath=<STDIN>; |
|---|
| 30 | chomp($repopath); |
|---|
| 31 | |
|---|
| 32 | print STDERR "running trac-admin:\n"; |
|---|
| 33 | system(qw(/usr/bin/trac-admin tracdata initenv), |
|---|
| 34 | $name, $dbstring, $repotype, $repopath, '/usr/share/trac/templates'); |
|---|
| 35 | # XXX this exposes the SQL password on the command line |
|---|
| 36 | |
|---|
| 37 | #aka perl -pe 's/\@ADDREND\@/$addrend/g' <.htaccess.in >.htaccess |
|---|
| 38 | open IN, '<.htaccess.in'; open OUT, '>.htaccess'; |
|---|
| 39 | while (<IN>) { |
|---|
| 40 | s/\@ADDREND\@/$addrend/g; |
|---|
| 41 | print OUT $_; |
|---|
| 42 | } |
|---|
| 43 | close IN; close OUT; |
|---|
| 44 | |
|---|
| 45 | chmod 0777, '.htaccess'; |
|---|
| 46 | unlink '.htaccess.in'; |
|---|
| 47 | |
|---|
| 48 | exit 0; |
|---|
Note: See
TracBrowser
for help on using the repository browser.