Commit | Line | Data |
---|---|---|
8b032c9e SC |
1 | README.txt |
2 | ||
3 | DESCRIPTION: | |
4 | Apply or unapply a patch to remote Evergreen hosts | |
5 | ||
6 | USAGE: | |
7 | ./patch-eg.sh -p ID [ -b backup_label ] [ -P rule ] [ -y ] [ -R ] [ -h ] host1 host2... | |
8 | ||
9 | OPTIONS: | |
10 | -p SHA1 ID of patch to apply (mandatory) | |
11 | -b Backup label of patch | |
12 | Defaults to patch ID | |
13 | -P Patch rule (web, xul, perl) to determine patch directory, user, and strip level | |
14 | Defaults to 'web' | |
15 | -y Yes, apply the patch instead of doing a dry run | |
16 | -R Reverse or undo the patch instead of applying it | |
17 | -h Print this message and exit | |
18 | ||
19 | EXAMPLES: | |
20 | ||
21 | Use the script to apply and unapply a Perl patch on two of the production servers: | |
22 | ||
23 | 1. Perform a dry run to see what it will do | |
24 | ||
25 | # patch-eg.sh -p 1234567 -b rt12345 -P perl app1-1 app1-2 | |
26 | ||
27 | 2. Rerun it using the -y option to actually apply the patch | |
28 | ||
29 | # patch-eg.sh -p 1234567 -b rt12345 -P perl -y app1-1 app1-2 | |
30 | ||
31 | 3. To unapply the patch, run the script with the -R option as well | |
32 | ||
33 | # patch-eg.sh -p 1234567 -b rt12345 -P perl -y -R app1-1 app1-2 | |
34 | ||
35 | NOTES: | |
36 | ||
37 | The script logs in as 'sitkastaff' via SSH to each host, and then runs the | |
38 | patch command via sudo. Consequently, the script can ask for an account | |
39 | password many times. To avoid having to repeatedly type a password, run the | |
40 | script on the local server as 'sitkastaff' and have the account's public SSH | |
41 | key installed on the target servers. | |
42 | ||
43 | As a convenience, the above procedure has been done on 'sitkastaff@coconut', so | |
44 | that if the script is run on 'coconut' as 'sitkastaff', the script will only | |
45 | ask for a sudo password. Moreover, requiring a sudo password could be avoided | |
46 | if the PAM module PAM_SSH_AGENT_AUTH is installed and configured on target | |
47 | hosts. | |
48 | ||
49 | A limitation to the script is that it cannot easily apply a patch that mixes up | |
50 | changes to Perl files, XUL files, or Javascript files, because they would be | |
51 | installed on directories differently from their directories in the source | |
52 | directory. | |
53 | ||
54 | TO DO: | |
55 | ||
56 | 1. Handle duplicate hostnames specified on the command line. For example, | |
57 | ||
58 | # patch-eg.sh -p 1234567 app1-1 app1-1 | |
59 | ||
60 | would apply the patch to app1-1 once. | |
61 | ||
62 | 2. Perform filename expansion on hostnames. For example | |
63 | ||
64 | # patch-eg.sh -p 1234567 -P perl app[123]-[12] | |
65 | ||
66 | would apply the Perl patch to six servers, app1-1, app1-2, app2-1, app2-2, | |
67 | app3-1, app3-2. | |
68 | ||
69 | 3. Is it possible to get location of patch repository from git configuration? | |
70 |