]> scripts.mit.edu Git - wizard.git/commitdiff
More comments, more utils, unfurl modded to work with Wordpress.
authorEdward Z. Yang <edwardzyang@thewritingpot.com>
Tue, 16 Jun 2009 06:14:56 +0000 (02:14 -0400)
committerEdward Z. Yang <edwardzyang@thewritingpot.com>
Tue, 16 Jun 2009 06:14:56 +0000 (02:14 -0400)
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
TODO
bin/get-url [new file with mode: 0755]
bin/unfurl

diff --git a/TODO b/TODO
index dcf5c6257233eabd0f4cb1c7b3ca14e1472424ce..2a1460c594088a78efbec5dd6efc92c60777d694 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,18 +2,23 @@ The Git Autoinstaller
 
 TODO NOW:
 
-- Fix mediawiki repository (has lots of stale files and a weird
-  history. This also means that the ichuang wiki will need to be
-  remigrated; frob .scripts-version to make it acceptable, but
-  otherwise should be fairly trivial).  When I say "fix", I mean
-  "redo". Thorough documentation would be good too.  Some bits
-  can be automated and/or have tools to assist it
 - Whiteboard the flow for performing an upgrade on a single
   install. How assisted does it need to be?
 - Conduct migration tool testing
 - Create mass-migration tool (should be able to limit on mediawiki)
 - Run parallel-find.pl
 - Migrate all mediawikis
+- Wordpress needs to have a .scripts/update script written for
+  its latest version
+
+NOTES:
+
+- A perfectly formed autoinstall with upgrade paths for all of
+  the intervening versions is not really feasible to implement.
+  As such, we want to migrate everything to -scripts, and then
+  generate a -scripts2 with the correct .scripts directory.
+  We will then nop update some installs, but this will prevent
+  us from having to migrate and update concurrently.
 
 OVERALL PLAN:
 
@@ -98,10 +103,11 @@ OVERALL PLAN:
 [TO SET IT UP]
 # let app-1.2.3 be the scripts folder originally in deploydev
 # let this folder be srv/
-mkdir app
-cd app
-git init
-cd ..
+# you can also do a git clone
+    mkdir app
+    cd app
+    git init
+    cd ..
 unfurl app-1.2.3 app
 # NOTE: contents of application are now in app directory
 cd app
@@ -110,11 +116,6 @@ git commit -s -m "App 1.2.3"
 git tag v1.2.3
 git branch pristine
 # NOTE: you're still on master branch
-mkdir .scripts
-echo "Deny from all" > .scripts/.htaccess
-touch .scripts/update
-chmod a+x .scripts/update
-# OPERATION: create the update script
 # WARNING: the following operation might require -p1
 patch -p0 < ../app-1.2.3/app-1.2.3.patch
 # NOTE: please sanity check the patch!
@@ -137,6 +138,7 @@ git add .
 git commit -as -m "App 1.2.3"
 git tag v1.2.3
 [IF THE PATCH HAS CHANGED]
+    # You are on the pristine branch
     # NOTE: Now, the tricky part (this is different from a real update)
     git symbolic-ref HEAD refs/heads/master
     # NOTE: Now, we think we're on the master branch, but we have
@@ -144,10 +146,8 @@ git tag v1.2.3
     # NOTE: -p0 might need to be twiddled
     patch -p0 < ../app-1.2.3/app-1.2.3.patch
     git add .
-    # NOTE: DON'T FORGET THIS STEP!!! Otherwise fixing this is going
-    # to be painful later down the line
-    git checkout .scripts
-    # OPERATION: Check if the directory needs an updated update script
+    # COMMENT: used to git checkout .scripts here
+    # then check if the directory needs an updated update script
     # NOTE: Fake the merge
     git rev-parse pristine > .git/MERGE_HEAD
 [IF THE PATCH HASN'T CHANGED]
@@ -163,6 +163,13 @@ git tag v1.2.3-scripts
 
     - A .scripts directory, which contains the following information:
 
+        [IF THIS IS THE FIRST UPDATE]
+            mkdir .scripts
+            echo "Deny from all" > .scripts/.htaccess
+            touch .scripts/update
+            chmod a+x .scripts/update
+            # OPERATION: create the update script
+
         * .scripts/update shell script (with the +x bit set appropriately),
           which performs the commands necessary to update a script.  This can
           be in any language.
diff --git a/bin/get-url b/bin/get-url
new file mode 100755 (executable)
index 0000000..894ae4e
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+# This script is a gem from the Wordpress 2.0.2-2.0.3 upgrade that
+# calculates the URL a given path will have on scripts. It does three
+# things:
+#   1. Resolves all symbolic links
+#   2. Splits the path on web_scripts to home and path
+#   3. Use home to ldap search for the name of the locker we're serving
+#   4. Build the URL from the kaboodle
+readlink -f $1 | sed 's,/web_scripts, ,' | (read home path; user=$(ldapsearch -LLL -h scripts.mit.edu -x -b ou=People,dc=scripts,dc=mit,dc=edu "homeDirectory=$home" uid | sed -n 's/^uid: // p'); [ -n "$user" ] && echo "http://$user.scripts.mit.edu$path")
index a9f4f01b3ca21bdfa78f3fd695f7d5b77209726a..c06ac3995754f2db2d0f2a5edf534ec9f57ca8a5 100755 (executable)
@@ -12,4 +12,4 @@ cd ..
 #patch -p0 < $1.patch
 #rm $1.patch
 #cd ..
-cp -Rp $1/$1/. $2
+cp -Rp $1/$2/. $2