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:
[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
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 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
# 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]
- 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.
--- /dev/null
+#!/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")