]> scripts.mit.edu Git - wizard.git/blob - TODO
Flesh out object model for .scripts-version; not all fiddly bits
[wizard.git] / TODO
1 The Git Autoinstaller
2
3 TODO NOW:
4
5 * Migrate and upgrade the lone mediawiki-1.5.6 install
6 * Create the migration script
7
8 OVERALL PLAN:
9
10 * Some parts of the infrastructure will not be touched, although I plan
11   on documenting them.  Specifically, we will be keeping:
12
13     - parallel-find.pl, and the resulting
14 /mit/scripts/sec-tools/store/scriptslist
15
16     - The current install scripts will be kept in place, sans changes
17       necessary to make them use Git install of copying the script over.
18       Porting these scripts to Python and making them modular would be
19       nice, but is priority.  For the long term, seeing this scripts
20       be packaged with rest of our code would be optimal.
21
22 * The new procedure for generating an update is as follows:
23
24     1. Have the Git repository and working copy for the project on hand.
25
26     2. Download the new tarball
27
28     3. Extract the tarball over the working copy (`cp -R a/. b` works well)
29
30     4. Check if there are any special update procedures, and update the
31        .scripts/update shell script as necessary (this means that any
32        application specific update logic will be kept with the actual
33        source code.  The language of this update script will vary
34        depending on context.)
35
36     X. Check for empty directories and add stub files as necessary
37        (use preserve-empty-dir)
38
39     5. Commit your changes, and tag as v1.2.3-scripts
40
41     6. Run the "dry-run script", which uses Git commands to check how many
42        working copies apply the change cleanly, and writes out a logfile
43        with the working copies that don't apply cleanly.
44
45     7. Run the "limited run" script, which applies the update to our
46        test-bed, and lets us check the basic functionality of the update.
47
48     8. Run the "deploy" script, which applies the update to all working
49        copies possible, and sends mail to users to whom the working copy
50        did not apply cleanly. (It also frobs .scripts/version)
51
52     Note: The last three scripts will need to be implemented, with an
53           eye towards speed.
54
55 * How to migrate an old autoinstaller to the new autoinstaller
56
57     - Find the oldest tarball/patch set for the application that still
58       is in use and upgradable.
59
60     - Untar, apply patch, place in a directory (unfurl) and git init
61
62     - Commit this as the "pristine" version (branch "pristine")
63
64     - Apply scripts patches
65
66     - Create the .scripts directory and populate it with the interesting
67       information (see below)
68
69     - Commit this as the "scripts" version (branch "master")
70
71 * How to update the autoinstaller repository
72
73     - Checkout pristine branch
74     - Delete contents of pristine branch (excluding .git, try rm -Rf * and remove stragglers)
75     - Unfurl tarball
76     - Commit as new pristine branch
77     - Checkout scripts branch
78     - Merge pristine branch
79     - Fix as necessary
80
81 * The repository for a given application will contain the following files:
82
83     - The actual application's files, as from the official tarball
84
85     - A .scripts directory, which contains the following information:
86
87         * .scripts/update shell script (with the +x bit set appropriately),
88           which performs the commands necessary to update a script.  This can
89           be in any language.
90
91         * .scripts/.htaccess to prevent this directory from being accessed
92           from the web.
93
94         * .scripts/database (generated) contains the database the
95           user installed the script to, so scripts-remove can clean it
96
97         * .scripts/version (generated) which contains the version
98           last autoinstalled (as distinct from the actual version
99           the script is) (This is the same as .scripts-version right
100           now; probably want to keep that for now)
101
102     - Because there will be no .gitignore file, you *must not* run
103       `git add .` on an actual running copy of the application.
104       `git add -u .` will generally be safe, but preferred mode
105       of operation is to operate on a clean install.
106
107 * The migration process shall be as such:
108
109     1. git init
110
111     2. git remote add origin /foo
112
113     3. git config branch.master.merge refs/heads/master
114
115     4. git fetch origin
116
117     5. git reset v1.2.3-scripts
118
119     5. git checkout .scripts
120
121     6. Setup .scripts/version (probably pipe the output of real-version)
122         UNCLEAR if this is a good thing; if it is, make sure we add
123         a .gitignore to the .scripts directory
124
125 * We will not add special code to handle .htaccess; thus the kernel patch
126   for allowing Apache access to .htaccess sent to scripts-team@mit.edu
127   must be handled first.
128
129 * The autoupgrade shall be the process of:
130
131     # Make the directory not accessible by the outside world (htaccess, but be careful!)
132     git add -u .
133     git commit -m 'automatically generated backup'
134     git pull origin master
135     if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
136     ./.scripts/update
137     # Make it accessible
138
139   (with some more robust error checking)
140
141 * Make install-statistics generate nice pretty graphs of installs by date
142   (more histograms, will need to check actual .scripts-version files.)