Changeset 1217 for trunk


Ignore:
Timestamp:
Jun 30, 2009, 8:46:04 PM (15 years ago)
Author:
ezyang
Message:
Reverted changes improperly checked into trunk and not a development branch.
Location:
trunk/locker/deploy/bin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/locker/deploy/bin/mediawiki

    r1215 r1217  
    55
    66setup();
     7
     8`cp skins/common/images/mediawiki.png skins/common/images/wiki.png`;
     9`patch -s -p1 < /mit/scripts/deploy/mediawiki.patch`;
    710
    811print "\nPlease decide upon a title for your wiki and enter it below.\n";
  • trunk/locker/deploy/bin/onathena

    r1216 r1217  
    235235fi
    236236
     237# xavid: use p to keep the same permissions as in the file
     238athrun scripts gtar zxpf "/mit/scripts/deploy$scriptsdev/$deploy.tar.gz"
     239files=`athrun scripts gfind . -mindepth 1 -maxdepth 1 | grep -v .admin`
     240numfiles=`echo "$files" | wc -l`
     241if [ ! -z "$files" ]; then
     242    if [ "$numfiles" -eq 1 ]; then
     243        athrun scripts gfind . -mindepth 2 -maxdepth 2 | xargs -i mv \{} .
     244        rmdir "$files"
     245    fi
     246fi
     247if [ -f "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" ]; then
     248        nodot=`echo "$lname" | sed "/\./s///"`;
     249        sed -e "/SCRIPTS_USER/ s//$lname/" -e "/SCRIPTS_NODOT/ s//$nodot/" "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" > php.ini
     250        athrun scripts gfind . -mindepth 1 -type d -exec sh -c 'ln -sf "`echo "$1" | sed '\''s,[^/],,g; s,/,../,g'\''`php.ini" "$1/"' -- {} \;
     251fi
    237252cd "$origdir"
    238253
    239 vsshrun "deploy$scriptsdev/bin/$deploy" "$lname" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
     254vsshrun "deploy$scriptsdev/bin/$deploy" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"
    240255rm -f "$lroot/web_scripts/$addrend/.scripts-tmp"
    241256checkfailed
  • trunk/locker/deploy/bin/onserver.pm

    r1216 r1217  
    55use File::Spec::Functions;
    66use File::Basename;
    7 use File::Copy;
    87use Socket;
    98use Cwd qw(abs_path);
    109use POSIX qw(strftime);
    1110use LWP::UserAgent;
    12 use IPC::Open2;
    1311use URI;
    1412our @ISA = qw(Exporter);
     
    1715our $server = "scripts.mit.edu";
    1816
    19 our ($tmp, $USER, $HOME, $lname, $sname, $deploy, $addrend, $base_uri, $ua, $admin_username, $requires_sql, $addrlast, $sqlhost, $sqluser, $sqlpass, $sqldb, $admin_password, $scriptsdev, $human, $email);
     17our ($tmp, $USER, $HOME, $sname, $deploy, $addrend, $base_uri, $ua, $admin_username, $requires_sql, $addrlast, $sqlhost, $sqluser, $sqlpass, $sqldb, $admin_password, $scriptsdev, $human, $email);
    2018
    2119$tmp = ".scripts-tmp";
     
    8078  $HOME = $ENV{HOME};
    8179 
    82   ($lname, $sname, $deploy, $addrend, $admin_username, $requires_sql, $scriptsdev, $human) = @ARGV;
     80  ($sname, $deploy, $addrend, $admin_username, $requires_sql, $scriptsdev, $human) = @ARGV;
    8381  chdir "$HOME/web_scripts/$addrend";
    8482  $email = "$human\@mit.edu";
     
    124122  }
    125123
    126   # This code was originally in onathena
    127   my $repo = "/mit/scripts/wizard$scriptsdev/srv/$deploy.git";
    128   if(-e $repo) {
    129     # Much of this can be replaced with
    130     # system("git", "clone", "--shared", $repo, ".");
    131     # but only once we complete the FC11 transition and are running
    132     # a version of Git more recent than 1.6.1 on all servers.
    133     `git init`;
    134     open HTACCESS, '>', '.git/.htaccess' or die $!;
    135     print HTACCESS "Deny from all";
    136     close HTACCESS;
    137     open ALTERNATES, '>', '.git/objects/info/alternates' or die $!;
    138     print ALTERNATES "$repo/objects";
    139     close ALTERNATES;
    140     system("git", "remote", "add", "origin", $repo);
    141     `git config branch.master.remote origin`;
    142     `git config branch.master.merge refs/heads/master`;
    143     `git fetch origin`;
    144     `git branch --track master origin/master`;
    145     system("git checkout master"); # to get output
    146   } else {
    147     system("tar", "zxpf", "/mit/scripts/deploy$scriptsdev/$deploy.tar.gz");
    148     my @files = glob("* .*"); # You /don't/ want to match dotfiles
    149     if (@files == 3) {
    150       chdir $files[0] or die $!;
    151       for (glob("{,.??}*")) {
    152         move($_, catfile("..", $_)) || die $!;
    153       }
    154       chdir ".."
    155     }
    156     rmdir $files[0];
    157   }
    158   if(-f "/mit/scripts/deploy$scriptsdev/php.ini/$deploy") {
    159     # Copy in PHP file,  perform substitutions, and make symlinks
    160     # to php.ini in all subdirectories
    161     my $nodot = $lname; $nodot =~ s/\.//;
    162     open(PHPIN, "/mit/scripts/deploy$scriptsdev/php.ini/$deploy") || die $!;
    163     open(PHPOUT, ">", "php.ini") || die $!;
    164     while(<PHPIN>) {
    165       s/SCRIPTS_USER/$lname/;
    166       s/SCRIPTS_NODOT/$nodot/;
    167       print PHPOUT $_ or die $!;
    168     }
    169     close(PHPOUT) || die $!;
    170     close(PHPIN) || die $!;
    171     # athrun doesn't exist on scripts.  But find exists!  Use alternate script
    172     system("/mit/scripts/bin/fix-php-ini-scripts");
    173   }
    174 
    175124  print "\nConfiguring $sname...\n";
    176125  if($requires_sql) {
     
    178127  }
    179128 
    180   if(-e "/mit/scripts/wizard$scriptsdev/srv/$deploy.git") {
    181     # fake an empty commit to get version info
    182     my $pid = open2(\*GIT_OUT, \*GIT_IN, "git commit-tree HEAD: -p HEAD") or die "Can't execute git process";
    183     print GIT_IN "User autoinstalled application\n";
    184     print GIT_IN "Installed-by: ", $ENV{'USER'}, '@', getclienthostname(), "\n";
    185     close(GIT_IN);
    186     my $hash=<GIT_OUT>;
    187     chomp($hash);
    188     close(GIT_OUT);
    189     waitpid $pid, 0; # reap zombies
    190     system("git reset $hash");
    191   } else {
    192     open(VERSION, ">.scripts-version") or die "Can't write scripts-version file: $!\n";
    193     print VERSION strftime("%F %T %z\n", localtime);
    194     print VERSION $ENV{'USER'}, '@', getclienthostname(), "\n";
    195     my $tarball = abs_path("/mit/scripts/deploy$scriptsdev/$deploy.tar.gz");
    196     print VERSION $tarball, "\n";
    197     $tarball =~ s|/deploydev/|/deploy/|;
    198     print VERSION dirname($tarball), "\n";
    199     close(VERSION);
    200   }
     129  open(VERSION, ">.scripts-version") or die "Can't write scripts-version file: $!\n";
     130  print VERSION strftime("%F %T %z\n", localtime);
     131  print VERSION $ENV{'USER'}, '@', getclienthostname(), "\n";
     132  my $tarball = abs_path("/mit/scripts/deploy$scriptsdev/$deploy.tar.gz");
     133  print VERSION $tarball, "\n";
     134  $tarball =~ s|/deploydev/|/deploy/|;
     135  print VERSION dirname($tarball), "\n";
     136  close(VERSION);
    201137
    202138  select STDOUT;
Note: See TracChangeset for help on using the changeset viewer.