[1028] | 1 | -*- text -*- |
---|
| 2 | |
---|
| 3 | == How to update an autoinstaller to a new version of the upstream package == |
---|
| 4 | |
---|
| 5 | Things to check beforehand: |
---|
| 6 | - Make sure /mit/scripts/deploydev is up to date from /mit/scripts/deploy (deploydev is not a svn checkout and is probably missing changes from deploy) |
---|
| 7 | |
---|
| 8 | Steps: |
---|
| 9 | # Example values |
---|
| 10 | PKG=wordpress |
---|
| 11 | NEWVERS=2.5.1 |
---|
| 12 | OLDVERS=2.3.3 |
---|
| 13 | URL=http://www.example.com/download/wordpress-2.5.1.tar.gz |
---|
| 14 | |
---|
| 15 | # Create a new directory in /mit/scripts/deploydev for the new version |
---|
| 16 | mkdir /mit/scripts/deploydev/$PKG-$NEWVERS |
---|
| 17 | |
---|
| 18 | # Copy any scripts patches to the new directory |
---|
| 19 | cp /mit/scripts/deploydev/$PKG-$OLDVERS/*.patch /mit/scripts/deploydev/$PKG-$NEWVERS/ |
---|
| 20 | # Some scripts might have other files in here |
---|
| 21 | # Make sure the patch is still relevant for the current version of the package |
---|
| 22 | |
---|
| 23 | # Download the new package from the upstream site |
---|
| 24 | wget -O /mit/scripts/deploydev/$PKG-$NEWVERS/$PKG-$NEWVERS.tar.gz "$URL" |
---|
| 25 | |
---|
| 26 | # Update the symlink for the new package version |
---|
| 27 | cd /mit/scripts/deploydev && ln -nsf $PKG-$NEWVERS/$PKG-NEWVERS.tar.gz $PKG.tar.gz |
---|
| 28 | |
---|
| 29 | # Try an autoinstall |
---|
[1029] | 30 | ssh linerva -t env scriptsdev=dev athrun scripts |
---|
[1028] | 31 | |
---|
| 32 | # Fix any bugs that were introduced, probably in /mit/scripts/deploydev/bin/$PKG or /mit/scripts/bin/scripts-$PKG, or the patches |
---|
| 33 | |
---|
| 34 | # Commit your changes by moving them to /mit/scripts/deploy |
---|
| 35 | cp -a /mit/scripts/deploydev/$PKG-NEWVERS /mit/scripts/deploydev/$PKG.tar.gz /mit/scripts/deploy/ |
---|
| 36 | |
---|
| 37 | # Test the new version from linerva and athena.dialup |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | == How to generate an autoupdate == |
---|
| 41 | |
---|
| 42 | cd /tmp |
---|
| 43 | # Use --dev if you haven't pushed to deploy yet |
---|
| 44 | /mit/scripts/sbin/propose-update --dev $PKG $OLDVERS $NEWVERS |
---|
| 45 | cd $PKG-$OLDVERS-to-$NEWVERS.proposal |
---|
[1053] | 46 | # If there is any custom setup that needs to be performed |
---|
| 47 | # (e.g. something in /mit/scripts/deploy/bin), do so to the |
---|
| 48 | # $PKG-$OLDVERS and $PKG-$NEWVERS directories, then do |
---|
| 49 | (cd .. && /mit/scripts/sbin/propose-update --redo-all --dev $PKG $OLDVERS $NEWVERS) |
---|
[1028] | 50 | # Look at the files that were generated to make sure they're sane |
---|
[1053] | 51 | # If necessary, add pre- and post- hooks, such as for a DB update script |
---|
[1028] | 52 | emacs extra/prepatch.sh |
---|
| 53 | emacs extra/postpatch.sh |
---|
| 54 | # Generate the patch |
---|
[1053] | 55 | cd .. |
---|
[1028] | 56 | # --dev here means to put the update in /mit/scripts/deploydev/updates |
---|
| 57 | /mit/scripts/sbin/build-update --dev $PKG $OLDVERS $NEWVERS |
---|
[1050] | 58 | # Test the update by running cd /mit/foo/web_scripts/bar && /mit/scripts/deploydev/updates/$PKG-#OLDVERS-to-$NEWVERS/update "foo" |
---|
[1028] | 59 | |
---|
| 60 | # If necessary, repeat this process. You can edit the files in the |
---|
| 61 | # $PKG-$OLDVERS and $PKG-$NEWVERS subdirectories of the proposal, |
---|
| 62 | # passing --redo-* options to propose-update as necessary to cause it |
---|
| 63 | # to regenerate the file lists from the subdirectories |
---|