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