5 - Fix mediawiki repository (has lots of stale files and a weird
6 history. This also means that the ichuang wiki will need to be
7 remigrated; frob .scripts-version to make it acceptable, but
8 otherwise should be fairly trivial). When I say "fix", I mean
9 "redo". Thorough documentation would be good too. Some bits
10 can be automated and/or have tools to assist it
11 - Whiteboard the flow for performing an upgrade on a single
12 install. How assisted does it need to be?
13 - Conduct migration tool testing
14 - Create mass-migration tool (should be able to limit on mediawiki)
15 - Run parallel-find.pl
16 - Migrate all mediawikis
20 * Some parts of the infrastructure will not be touched, although I plan
21 on documenting them. Specifically, we will be keeping:
23 - parallel-find.pl, and the resulting
24 /mit/scripts/sec-tools/store/scriptslist
26 - The current install scripts will be kept in place, sans changes
27 necessary to make them use Git install of copying the script over.
28 Porting these scripts to Python and making them modular would be
29 nice, but is priority. For the long term, seeing this scripts
30 be packaged with rest of our code would be optimal.
32 * The new procedure for generating an update is as follows (this is
33 also similar to procedure for creating these repositories):
35 1. Have the Git repository and working copy for the project on hand.
37 2. Checkout the pristine branch
39 3. Remove all files from the working copy (rm -Rf *, and then delete
40 any dot stragglers. A script to do this would be handy)
42 4. Download the new tarball
44 5. Extract the tarball over the working copy (`cp -R a/. b` works well,
45 remember that the working copy is empty)
47 6. Check for empty directories and add stub files as necessary
48 (use preserve-empty-dir)
50 7. Git add it all, and then commit as a new pristine version (v1.2.3)
52 8. Checkout the master branch
54 9. [FOR EXISTING REPOSITORIES]
55 Merge the pristine branch in. Resolve any conflicts that our
56 patches have with new changes. Do NOT let Git auto-commit it
57 with --no-commit (otherwise, you want to git commit --amend
58 to keep our history clean
61 Apply the scripts patch that was used for that version here
62 (usually patch -p1 < patch)
64 10. Check if there are any special update procedures, and update the
65 .scripts/update shell script as necessary (this means that any
66 application specific update logic will be kept with the actual
67 source code. The language of this update script will vary
68 depending on context.)
70 11. Commit your changes, and tag as v1.2.3-scripts
72 If you're setting up a repository from scratch, stop here, and
75 XXX: Should we force people to push to the real repository at
76 this point, or just make the repository that the script pulls
77 stuff out of configurable? (Twiddling origin can get you a
78 devel setup with no code changes)
80 12. Run the "dry-run script", which uses Git commands to check how many
81 working copies apply the change cleanly, and writes out a logfile
82 with the working copies that don't apply cleanly.
84 13. Run the "limited run" script, which applies the update to our
85 test-bed, and lets us check the basic functionality of the update.
86 This can include a script that lets us update a single directory
89 14. Run the "deploy" script, which applies the update to all working
90 copies possible, and sends mail to users to whom the working copy
91 did not apply cleanly. It also frobs .scripts/version for successful
94 15. Run parallel-find.pl
96 * For mass importing into the repository, the steps are:
99 # let app-1.2.3 be the scripts folder originally in deploydev
100 # let this folder be srv/
106 # NOTE: contents of application are now in app directory
109 git commit -s -m "App 1.2.3"
112 # NOTE: you're still on master branch
114 echo "Deny from all" > .scripts/.htaccess
115 touch .scripts/update
116 chmod a+x .scripts/update
117 # OPERATION: create the update script
118 # WARNING: the following operation might require -p1
119 patch -p0 < ../app-1.2.3/app-1.2.3.patch
120 # NOTE: please sanity check the patch!
122 # NOTE: -a flag is to handle if the patch deleted something
123 git commit -as -m "App 1.2.3-scripts"
124 git tag v1.2.3-scripts
127 # let this folder be srv/app.git
128 git checkout pristine
129 # NOTE: this preserves your .git folder, but removes everything
134 # NOTE: please sanity check app directory
136 # NOTE: -a is to take care of deletions
137 git commit -as -m "App 1.2.3"
139 [IF THE PATCH HAS CHANGED]
140 # NOTE: Now, the tricky part (this is different from a real update)
141 git symbolic-ref HEAD refs/heads/master
142 # NOTE: Now, we think we're on the master branch, but we have
143 # pristine copy checked out
144 # NOTE: -p0 might need to be twiddled
145 patch -p0 < ../app-1.2.3/app-1.2.3.patch
147 # NOTE: DON'T FORGET THIS STEP!!! Otherwise fixing this is going
148 # to be painful later down the line
149 git checkout .scripts
150 # OPERATION: Check if the directory needs an updated update script
151 # NOTE: Fake the merge
152 git rev-parse pristine > .git/MERGE_HEAD
153 [IF THE PATCH HASN'T CHANGED]
155 git merge --no-commit pristine
156 git commit -as -m "App 1.2.3-scripts"
157 git tag v1.2.3-scripts
160 * The repository for a given application will contain the following files:
162 - The actual application's files, as from the official tarball
164 - A .scripts directory, which contains the following information:
166 * .scripts/update shell script (with the +x bit set appropriately),
167 which performs the commands necessary to update a script. This can
170 * .scripts/.htaccess to prevent this directory from being accessed
173 * .scripts/database (generated) contains the database the
174 user installed the script to, so scripts-remove can clean it
176 XXX: Could cause problems if a user copies the autoinstall,
177 fiddles with the DB credentials, and then scripts-remove's
178 the autoinstall. Possible fix is to add the original
179 directory as a sanity check. Additionally, we could have
180 the application read out of this file.
182 * .scripts/version (generated) which contains the version
183 last autoinstalled (as distinct from the actual version
184 the script is) (This is the same as .scripts-version right
185 now; probably want to keep that for now)
187 XXX: It's unclear if we want to move to this wholesale, or
188 delay this indefinitely.
190 * The migration process has been implemented, see 'wizard migrate'.
192 XXX: We have not decided what migration should do to .scripts-version;
193 if it does move it to .scripts, repositories should have a .gitignore
196 * The autoupgrade shall be the process of:
198 # Make the directory not accessible by the outside world (htaccess, but be careful!)
200 git commit -m 'automatically generated backup'
201 git pull origin master
202 if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
206 (with some more robust error checking)
208 * Make 'wizard summary' generate nice pretty graphs of installs by date
209 (more histograms, will need to check actual .scripts-version files.)