5 - Whiteboard the flow for performing an upgrade on a single
6 install. How assisted does it need to be?
7 - Conduct migration tool testing
8 - Create mass-migration tool (should be able to limit on mediawiki)
10 - Migrate all mediawikis
11 - Wordpress needs to have a .scripts/update script written for
16 - A perfectly formed autoinstall with upgrade paths for all of
17 the intervening versions is not really feasible to implement.
18 As such, we want to migrate everything to -scripts, and then
19 generate a -scripts2 with the correct .scripts directory.
20 We will then nop update some installs, but this will prevent
21 us from having to migrate and update concurrently.
25 * Some parts of the infrastructure will not be touched, although I plan
26 on documenting them. Specifically, we will be keeping:
28 - parallel-find.pl, and the resulting
29 /mit/scripts/sec-tools/store/scriptslist
31 - The current install scripts will be kept in place, sans changes
32 necessary to make them use Git install of copying the script over.
33 Porting these scripts to Python and making them modular would be
34 nice, but is priority. For the long term, seeing this scripts
35 be packaged with rest of our code would be optimal.
37 * The new procedure for generating an update is as follows (this is
38 also similar to procedure for creating these repositories):
40 1. Have the Git repository and working copy for the project on hand.
42 2. Checkout the pristine branch
44 3. Remove all files from the working copy (rm -Rf *, and then delete
45 any dot stragglers. A script to do this would be handy)
47 4. Download the new tarball
49 5. Extract the tarball over the working copy (`cp -R a/. b` works well,
50 remember that the working copy is empty)
52 6. Check for empty directories and add stub files as necessary
53 (use preserve-empty-dir)
55 7. Git add it all, and then commit as a new pristine version (v1.2.3)
57 8. Checkout the master branch
59 9. [FOR EXISTING REPOSITORIES]
60 Merge the pristine branch in. Resolve any conflicts that our
61 patches have with new changes. Do NOT let Git auto-commit it
62 with --no-commit (otherwise, you want to git commit --amend
63 to keep our history clean
66 Apply the scripts patch that was used for that version here
67 (usually patch -p1 < patch)
69 10. Check if there are any special update procedures, and update the
70 .scripts/update shell script as necessary (this means that any
71 application specific update logic will be kept with the actual
72 source code. The language of this update script will vary
73 depending on context.)
75 11. Commit your changes, and tag as v1.2.3-scripts
77 If you're setting up a repository from scratch, stop here, and
80 XXX: Should we force people to push to the real repository at
81 this point, or just make the repository that the script pulls
82 stuff out of configurable? (Twiddling origin can get you a
83 devel setup with no code changes)
85 12. Run the "dry-run script", which uses Git commands to check how many
86 working copies apply the change cleanly, and writes out a logfile
87 with the working copies that don't apply cleanly.
89 13. Run the "limited run" script, which applies the update to our
90 test-bed, and lets us check the basic functionality of the update.
91 This can include a script that lets us update a single directory
94 14. Run the "deploy" script, which applies the update to all working
95 copies possible, and sends mail to users to whom the working copy
96 did not apply cleanly. It also frobs .scripts/version for successful
99 15. Run parallel-find.pl
101 * For mass importing into the repository, the steps are:
104 # let app-1.2.3 be the scripts folder originally in deploydev
105 # let this folder be srv/
106 # you can also do a git clone
112 # NOTE: contents of application are now in app directory
115 git commit -s -m "App 1.2.3"
118 # NOTE: you're still on master branch
119 # WARNING: the following operation might require -p1
120 patch -p0 < ../app-1.2.3/app-1.2.3.patch
121 # NOTE: please sanity check the patch!
123 # NOTE: -a flag is to handle if the patch deleted something
124 git commit -as -m "App 1.2.3-scripts"
125 git tag v1.2.3-scripts
128 # let this folder be srv/app.git
129 git checkout pristine
130 # NOTE: this preserves your .git folder, but removes everything
135 # NOTE: please sanity check app directory
137 # NOTE: -a is to take care of deletions
138 git commit -as -m "App 1.2.3"
140 [IF THE PATCH HAS CHANGED]
141 # You are on the pristine branch
142 # NOTE: Now, the tricky part (this is different from a real update)
143 git symbolic-ref HEAD refs/heads/master
144 # NOTE: Now, we think we're on the master branch, but we have
145 # pristine copy checked out
146 # NOTE: -p0 might need to be twiddled
147 patch -p0 < ../app-1.2.3/app-1.2.3.patch
149 # COMMENT: used to git checkout .scripts here
150 # then 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 [IF THIS IS THE FIRST UPDATE]
168 echo "Deny from all" > .scripts/.htaccess
169 touch .scripts/update
170 chmod a+x .scripts/update
171 # OPERATION: create the update script
173 * .scripts/update shell script (with the +x bit set appropriately),
174 which performs the commands necessary to update a script. This can
177 * .scripts/.htaccess to prevent this directory from being accessed
180 * .scripts/database (generated) contains the database the
181 user installed the script to, so scripts-remove can clean it
183 XXX: Could cause problems if a user copies the autoinstall,
184 fiddles with the DB credentials, and then scripts-remove's
185 the autoinstall. Possible fix is to add the original
186 directory as a sanity check. Additionally, we could have
187 the application read out of this file.
189 * .scripts/version (generated) which contains the version
190 last autoinstalled (as distinct from the actual version
191 the script is) (This is the same as .scripts-version right
192 now; probably want to keep that for now)
194 XXX: It's unclear if we want to move to this wholesale, or
195 delay this indefinitely.
197 * The migration process has been implemented, see 'wizard migrate'.
199 XXX: We have not decided what migration should do to .scripts-version;
200 if it does move it to .scripts, repositories should have a .gitignore
203 * The autoupgrade shall be the process of:
205 # Make the directory not accessible by the outside world (htaccess, but be careful!)
207 git commit -m 'automatically generated backup'
208 git pull origin master
209 if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
213 (with some more robust error checking)
215 * Make 'wizard summary' generate nice pretty graphs of installs by date
216 (more histograms, will need to check actual .scripts-version files.)