From: Edward Z. Yang Date: Tue, 16 Jun 2009 03:05:48 +0000 (-0400) Subject: Drastically improved TODO docs and bin. X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/commitdiff_plain/9f42fbb66d7dd898936d4364235c3f23d82c0a7d Drastically improved TODO docs and bin. Signed-off-by: Edward Z. Yang --- diff --git a/TODO b/TODO index a757eb0..dcf5c62 100644 --- 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 diff --git a/bin/unfurl b/bin/unfurl index feff917..a9f4f01 100755 --- a/bin/unfurl +++ b/bin/unfurl @@ -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 index 0000000..e8aea2f --- /dev/null +++ b/bin/wipe-working-dir @@ -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 ..