Changeset 1216 for trunk/locker/deploy/bin
- Timestamp:
- Jun 30, 2009, 8:37:53 PM (15 years ago)
- Location:
- trunk/locker/deploy/bin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/locker/deploy/bin/onathena
r1215 r1216 235 235 fi 236 236 237 # xavid: use p to keep the same permissions as in the file238 repo="/mit/scripts/wizard$scriptsdev/srv/$deploy.git"239 if [ -e "$repo" ]; then240 admin=`cat .admin`241 rm .admin242 ls -Al243 athrun git git init244 echo "Deny from all" > ".git/.htaccess"245 echo "$repo/objects" > ".git/objects/info/alternates"246 athrun git git remote add origin "$repo"247 athrun git git config branch.master.remote origin248 athrun git git config branch.master.merge refs/heads/master249 athrun git git fetch origin250 athrun git git branch --track master origin/master251 athrun git git checkout master252 echo "$admin" > .admin253 else254 athrun scripts gtar zxpf "/mit/scripts/deploy$scriptsdev/$deploy.tar.gz"255 files=`athrun scripts gfind . -mindepth 1 -maxdepth 1 | grep -v .admin`256 numfiles=`echo "$files" | wc -l`257 if [ ! -z "$files" ]; then258 if [ "$numfiles" -eq 1 ]; then259 athrun scripts gfind . -mindepth 2 -maxdepth 2 | xargs -i mv \{} .260 rmdir "$files"261 fi262 fi263 fi264 if [ -f "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" ]; then265 nodot=`echo "$lname" | sed "/\./s///"`;266 sed -e "/SCRIPTS_USER/ s//$lname/" -e "/SCRIPTS_NODOT/ s//$nodot/" "/mit/scripts/deploy$scriptsdev/php.ini/$deploy" > php.ini267 athrun scripts gfind . -mindepth 1 -type d -exec sh -c 'ln -sf "`echo "$1" | sed '\''s,[^/],,g; s,/,../,g'\''`php.ini" "$1/"' -- {} \;268 fi269 237 cd "$origdir" 270 238 271 vsshrun "deploy$scriptsdev/bin/$deploy" "$ sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration"239 vsshrun "deploy$scriptsdev/bin/$deploy" "$lname" "$sname" "$deploy" "$addrend" "$admin_username" "$requires_sql" "$scriptsdev" "$USER" || die "Unknown failure during configuration" 272 240 rm -f "$lroot/web_scripts/$addrend/.scripts-tmp" 273 241 checkfailed -
trunk/locker/deploy/bin/onserver.pm
r1215 r1216 5 5 use File::Spec::Functions; 6 6 use File::Basename; 7 use File::Copy; 7 8 use Socket; 8 9 use Cwd qw(abs_path); … … 16 17 our $server = "scripts.mit.edu"; 17 18 18 our ($tmp, $USER, $HOME, $ sname, $deploy, $addrend, $base_uri, $ua, $admin_username, $requires_sql, $addrlast, $sqlhost, $sqluser, $sqlpass, $sqldb, $admin_password, $scriptsdev, $human, $email);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); 19 20 20 21 $tmp = ".scripts-tmp"; … … 79 80 $HOME = $ENV{HOME}; 80 81 81 ($ sname, $deploy, $addrend, $admin_username, $requires_sql, $scriptsdev, $human) = @ARGV;82 ($lname, $sname, $deploy, $addrend, $admin_username, $requires_sql, $scriptsdev, $human) = @ARGV; 82 83 chdir "$HOME/web_scripts/$addrend"; 83 84 $email = "$human\@mit.edu"; … … 123 124 } 124 125 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 125 175 print "\nConfiguring $sname...\n"; 126 176 if($requires_sql) {
Note: See TracChangeset
for help on using the changeset viewer.