The Git Autoinstaller
+TODO NOW:
+
+* Migrate and upgrade the lone mediawiki-1.5.6 install
+* Create the migration script
+
+OVERALL PLAN:
+
* Some parts of the infrastructure will not be touched, although I plan
on documenting them. Specifically, we will be keeping:
2. Download the new tarball
- 3. Extract the tarball over the working copy
+ 3. Extract the tarball over the working copy (`cp -R a/. b` works well)
4. Check if there are any special update procedures, and update the
.scripts/update shell script as necessary (this means that any
- Find the oldest tarball/patch set for the application that still
is in use and upgradable.
- - Untar, apply patch, place in a directory and git init
+ - Untar, apply patch, place in a directory (unfurl) and git init
+
+ - Commit this as the "pristine" version (branch "pristine")
+
+ - Apply scripts patches
- Create the .scripts directory and populate it with the interesting
information (see below)
+ - Commit this as the "scripts" version (branch "master")
+
+* How to update the autoinstaller repository
+
+ - Checkout pristine branch
+ - Delete contents of pristine branch (excluding .git, try rm -Rf * and remove stragglers)
+ - Unfurl tarball
+ - Commit as new pristine branch
+ - Checkout scripts branch
+ - Merge pristine branch
+ - Fix as necessary
+
* The repository for a given application will contain the following files:
- The actual application's files, as from the official tarball
which performs the commands necessary to update a script. This can
be in any language.
- * .scripts/version which contains the version last autoinstalled
- (as distinct from the actual version the script is) (This will
- be auto-generated and should not be versioned)
-
- * .scripts/real-version (+x) which checks the source code to find the
- actual version of the application
-
* .scripts/.htaccess to prevent this directory from being accessed
from the web.
+ * .scripts/database (generated) contains the database the
+ user installed the script to, so scripts-remove can clean it
+
+ * .scripts/version (generated) which contains the version
+ last autoinstalled (as distinct from the actual version
+ the script is) (This is the same as .scripts-version right
+ now; probably want to keep that for now)
+
- Because there will be no .gitignore file, you *must not* run
`git add .` on an actual running copy of the application.
- `git add -u .` will generally be safe.
+ `git add -u .` will generally be safe, but preferred mode
+ of operation is to operate on a clean install.
* The migration process shall be as such:
1. git init
- 2. git add remote origin /foo
+ 2. git remote add origin /foo
- 3. whatever the merge frob is
+ 3. git config branch.master.merge refs/heads/master
4. git fetch origin
- 5. git reset
+ 5. git reset v1.2.3-scripts
+
+ 5. git checkout .scripts
6. Setup .scripts/version (probably pipe the output of real-version)
+ UNCLEAR if this is a good thing; if it is, make sure we add
+ a .gitignore to the .scripts directory
* We will not add special code to handle .htaccess; thus the kernel patch
for allowing Apache access to .htaccess sent to scripts-team@mit.edu
* The autoupgrade shall be the process of:
+ # Make the directory not accessible by the outside world (htaccess, but be careful!)
git add -u .
git commit -m 'automatically generated backup'
- git pull /mit/scripts/deploy/wordpress.git master
+ git pull origin master
if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
./.scripts/update
+ # Make it accessible
+
+ (with some more robust error checking)
* Make install-statistics generate nice pretty graphs of installs by date
(more histograms, will need to check actual .scripts-version files.)