5 - Check how many autoinstalls are missing w bits for
7 - Whiteboard the flow for performing an upgrade on a single
8 install. How assisted does it need to be?
9 - Conduct migration tool testing (check andersk, geofft for
11 - Set up migration server
12 - Run parallel-find.pl
13 - Migrate all mediawikis
14 - Wordpress needs to have a .scripts/update script written for
19 - A perfectly formed autoinstall with upgrade paths for all of
20 the intervening versions is not really feasible to implement.
21 As such, we want to migrate everything to -scripts, and then
22 generate a -scripts2 with the correct .scripts directory.
23 We will then nop update some installs, but this will prevent
24 us from having to migrate and update concurrently.
26 - summary and info are still not using loggers. Maybe they should,
29 - We need another patched AFS server to deploy updates off of.
33 * Some parts of the infrastructure will not be touched, although I plan
34 on documenting them. Specifically, we will be keeping:
36 - parallel-find.pl, and the resulting
37 /mit/scripts/sec-tools/store/scriptslist
39 - The current install scripts will be kept in place, sans changes
40 necessary to make them use Git install of copying the script over.
41 Porting these scripts to Python and making them modular would be
42 nice, but is priority. For the long term, seeing this scripts
43 be packaged with rest of our code would be optimal.
45 * The new procedure for generating an update is as follows (this is
46 also similar to procedure for creating these repositories):
48 1. Have the Git repository and working copy for the project on hand.
50 2. Checkout the pristine branch
52 3. Remove all files from the working copy (rm -Rf *, and then delete
53 any dot stragglers. A script to do this would be handy)
55 4. Download the new tarball
57 5. Extract the tarball over the working copy (`cp -R a/. b` works well,
58 remember that the working copy is empty)
60 6. Check for empty directories and add stub files as necessary
61 (use preserve-empty-dir)
63 7. Git add it all, and then commit as a new pristine version (v1.2.3)
65 8. Checkout the master branch
67 9. [FOR EXISTING REPOSITORIES]
68 Merge the pristine branch in. Resolve any conflicts that our
69 patches have with new changes. Do NOT let Git auto-commit it
70 with --no-commit (otherwise, you want to git commit --amend
71 to keep our history clean
74 Apply the scripts patch that was used for that version here
75 (usually patch -p1 < patch)
77 10. Check if there are any special update procedures, and update the
78 .scripts/update shell script as necessary (this means that any
79 application specific update logic will be kept with the actual
80 source code. The language of this update script will vary
81 depending on context.)
83 11. Commit your changes, and tag as v1.2.3-scripts
85 If you're setting up a repository from scratch, stop here, and
88 XXX: Should we force people to push to the real repository at
89 this point, or just make the repository that the script pulls
90 stuff out of configurable? (Twiddling origin can get you a
91 devel setup with no code changes)
93 12. Run the "dry-run script", which uses Git commands to check how many
94 working copies apply the change cleanly, and writes out a logfile
95 with the working copies that don't apply cleanly.
97 13. Run the "limited run" script, which applies the update to our
98 test-bed, and lets us check the basic functionality of the update.
99 This can include a script that lets us update a single directory
102 14. Run the "deploy" script, which applies the update to all working
103 copies possible, and sends mail to users to whom the working copy
104 did not apply cleanly. It also frobs .scripts/version for successful
107 15. Run parallel-find.pl
109 * For mass importing into the repository, the steps are:
112 # let app-1.2.3 be the scripts folder originally in deploydev
113 # let this folder be srv/
114 # you can also do a git clone
120 # NOTE: contents of application are now in app directory
123 git commit -s -m "App 1.2.3"
126 # NOTE: you're still on master branch
127 # WARNING: the following operation might require -p1
128 patch -p0 < ../app-1.2.3/app-1.2.3.patch
129 # NOTE: please sanity check the patch!
131 # NOTE: -a flag is to handle if the patch deleted something
132 git commit -as -m "App 1.2.3-scripts"
133 git tag v1.2.3-scripts
136 # let this folder be srv/app.git
137 git checkout pristine
138 # NOTE: this preserves your .git folder, but removes everything
143 # NOTE: please sanity check app directory
145 # NOTE: -a is to take care of deletions
146 git commit -as -m "App 1.2.3"
148 [IF THE PATCH HAS CHANGED]
149 # You are on the pristine branch
150 # NOTE: Now, the tricky part (this is different from a real update)
151 git symbolic-ref HEAD refs/heads/master
152 # NOTE: Now, we think we're on the master branch, but we have
153 # pristine copy checked out
154 # NOTE: -p0 might need to be twiddled
155 patch -p0 < ../app-1.2.3/app-1.2.3.patch
157 # COMMENT: used to git checkout .scripts here
158 # then check if the directory needs an updated update script
159 # NOTE: Fake the merge
160 git rev-parse pristine > .git/MERGE_HEAD
161 [IF THE PATCH HASN'T CHANGED]
163 git merge --no-commit pristine
164 git commit -as -m "App 1.2.3-scripts"
165 git tag v1.2.3-scripts
168 * The repository for a given application will contain the following files:
170 - The actual application's files, as from the official tarball
172 - A .scripts directory, which contains the following information:
174 [IF THIS IS THE FIRST UPDATE]
176 echo "Deny from all" > .scripts/.htaccess
177 touch .scripts/update
178 chmod a+x .scripts/update
179 # OPERATION: create the update script
181 * .scripts/update shell script (with the +x bit set appropriately),
182 which performs the commands necessary to update a script. This can
185 * .scripts/.htaccess to prevent this directory from being accessed
188 * .scripts/database (generated) contains the database the
189 user installed the script to, so scripts-remove can clean it
191 XXX: Could cause problems if a user copies the autoinstall,
192 fiddles with the DB credentials, and then scripts-remove's
193 the autoinstall. Possible fix is to add the original
194 directory as a sanity check. Additionally, we could have
195 the application read out of this file.
197 * .scripts/version (generated) which contains the version
198 last autoinstalled (as distinct from the actual version
199 the script is) (This is the same as .scripts-version right
200 now; probably want to keep that for now)
202 XXX: It's unclear if we want to move to this wholesale, or
203 delay this indefinitely.
205 * The migration process has been implemented, see 'wizard migrate'.
207 XXX: We have not decided what migration should do to .scripts-version;
208 if it does move it to .scripts, repositories should have a .gitignore
211 * The autoupgrade shall be the process of:
213 # Make the directory not accessible by the outside world (htaccess, but be careful!)
215 git commit -m 'automatically generated backup'
216 git pull origin master
217 if [ $? ne 0 ]; then git reset --hard; echo 'conflicts during upgrade'; fi
221 (with some more robust error checking)
223 * Make 'wizard summary' generate nice pretty graphs of installs by date
224 (more histograms, will need to check actual .scripts-version files.)