]> scripts.mit.edu Git - wizard.git/commitdiff
Drastically improved TODO docs and bin.
authorEdward Z. Yang <edwardzyang@thewritingpot.com>
Tue, 16 Jun 2009 03:05:48 +0000 (23:05 -0400)
committerEdward Z. Yang <edwardzyang@thewritingpot.com>
Tue, 16 Jun 2009 03:05:48 +0000 (23:05 -0400)
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
TODO
bin/unfurl
bin/wipe-working-dir [new file with mode: 0755]

diff --git a/TODO b/TODO
index a757eb07dfb6d3c994b023e3e98b1d04d91797af..dcf5c6257233eabd0f4cb1c7b3ca14e1472424ce 100644 (file)
--- a/TODO
+++ b/TODO
@@ -93,6 +93,70 @@ OVERALL PLAN:
 
    15. Run parallel-find.pl
 
+* For mass importing into the repository, the steps are:
+
+[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 ..
+unfurl app-1.2.3 app
+# NOTE: contents of application are now in app directory
+cd app
+git add .
+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!
+git add .
+# NOTE: -a flag is to handle if the patch deleted something
+git commit -as -m "App 1.2.3-scripts"
+git tag v1.2.3-scripts
+
+[TO ADD AN UPDATE]
+# let this folder be srv/app.git
+git checkout pristine
+# NOTE: this preserves your .git folder, but removes everything
+wipe-working-dir .
+cd ..
+unfurl app-1.2.3 app
+cd app
+# NOTE: please sanity check app directory
+git add .
+# NOTE: -a is to take care of deletions
+git commit -as -m "App 1.2.3"
+git tag v1.2.3
+[IF THE PATCH HAS CHANGED]
+    # 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
+    # pristine copy checked out
+    # 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
+    # NOTE: Fake the merge
+    git rev-parse pristine > .git/MERGE_HEAD
+[IF THE PATCH HASN'T CHANGED]
+    git checkout master
+    git merge --no-commit pristine
+git commit -as -m "App 1.2.3-scripts"
+git tag v1.2.3-scripts
+
+
 * The repository for a given application will contain the following files:
 
     - The actual application's files, as from the official tarball
@@ -111,7 +175,9 @@ OVERALL PLAN:
 
             XXX: Could cause problems if a user copies the autoinstall,
             fiddles with the DB credentials, and then scripts-remove's
-            the autoinstall
+            the autoinstall.  Possible fix is to add the original
+            directory as a sanity check.  Additionally, we could have
+            the application read out of this file.
 
         * .scripts/version (generated) which contains the version
           last autoinstalled (as distinct from the actual version
index feff917b136aec5c567c0bd0858974e06dfcdcae..a9f4f01b3ca21bdfa78f3fd695f7d5b77209726a 100755 (executable)
@@ -5,10 +5,11 @@ then
     echo "Takes a app-1.2.3 folder from deploy and pastes it over app"
     exit 1
 fi
-tar -xvf $1/$1.tar.gz
-rm $1/$1.tar.gz
 cd $1
-patch -p1 < $1.patch
-rm $1.patch
+tar -xvf $1.tar.gz
 cd ..
-cp -Rp $1/. $2
+#cd $1
+#patch -p0 < $1.patch
+#rm $1.patch
+#cd ..
+cp -Rp $1/$1/. $2
diff --git a/bin/wipe-working-dir b/bin/wipe-working-dir
new file mode 100755 (executable)
index 0000000..e8aea2f
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash -e
+if [[ "$1" = "" ]]
+then
+    echo "Usage: $0 dir"
+    echo "Takes a git working copy and removes all its files"
+    exit 1
+fi
+cd $1
+find . -not -path "./.git/*" -not -path "./.git" -delete
+cd ..