|
1 | | -# patch generation tool |
| 1 | +# JBoss AS / Wildfly Patch Generation Tool |
2 | 2 |
|
3 | | -### Steps creating a patch |
| 3 | +## Usage |
4 | 4 |
|
5 | | -1) `git clone https://github.com/emuckenhuber/patch-gen` |
| 5 | +Options are not optional and must exactly follow this format: `--optionname=value`. The `=` must be present when there is a value. There are no short forms for the option names. |
6 | 6 |
|
7 | | -2) `alias patch-gen=/path/to/patch-gen/tool/tool.sh` |
| 7 | +In the following sections, substitute `patch-gen` for `java -jar patch-gen-*-shaded.jar`, or set up an alias with |
8 | 8 |
|
9 | | -3) `cd /your/home/patches` |
| 9 | + alias patch-gen='java -jar patch-gen-*-shaded.jar' |
10 | 10 |
|
11 | | -4) edit patch-config-wildfly-CR2-patch.xml |
| 11 | +### Patch Generation |
| 12 | + patch-gen --applies-to-dist=~/wildfly/wildfly-8.0.0.Final --updated-dist=~/wildfly/wildfly-8.1.0.CR2 --patch-config=patch-config-wildfly-CR2-patch.xml --output-file=wildfly-8.1.0.CR2.patch.zip |
12 | 13 |
|
| 14 | +`--applies-to-dist` and `--updated-dist` must point exactly at the root of the distributions (the directory containing bin, modules, domain, etc.), otherwise the tool will crash. |
| 15 | + |
| 16 | +### Configuration Templating |
| 17 | + |
| 18 | +#### One off |
| 19 | + patch-gen --create-template --one-off my-custom-patch |
| 20 | + |
| 21 | +#### Cumulative |
| 22 | + patch-gen --create-template --cumulative my-custom-patch |
| 23 | + |
| 24 | +### Getting an executable jar |
| 25 | +You probably want to use the shaded jar, which is executable and contains all of its dependencies. |
| 26 | + |
| 27 | +#### Build from source |
| 28 | + git clone https://github.com/jbossas/patch-gen.git |
| 29 | + cd patch-gen/ |
| 30 | + mvn package |
| 31 | + |
| 32 | +The jars will be located in the `target/` subdirectory. |
| 33 | + |
| 34 | +#### Download from Github |
| 35 | + curl -LO 'https://github.com/jbossas/patch-gen/releases/download/1.0/patch-gen-1.0-shaded.jar' |
| 36 | + |
| 37 | +## Patch Workflow |
| 38 | + |
| 39 | +1. Run the command specified in the Configuration Templating section. |
| 40 | +2. Edit the configuration file. |
| 41 | +``` |
| 42 | +$EDITOR patch-config-wildfly-CR2-patch.xml |
| 43 | +``` |
13 | 44 | ```xml |
14 | 45 | <?xml version='1.0' encoding='UTF-8'?> |
15 | 46 | <patch-config xmlns="urn:jboss:patch-config:1.0"> |
|
23 | 54 | <generate-by-diff /> |
24 | 55 | </patch-config> |
25 | 56 | ``` |
26 | | - |
27 | | -5) `patch-gen --applies-to-dist=/your/home/Downloads/wildfly/wildfly-8.0.0.Final --updated-dist=/your/home/Downloads/wildfly/wildfly-8.1.0.CR2 --patch-config=patch-config-wildfly-CR2-patch.xml --output-file=wildfly-8.1.0.CR2.patch.zip` |
28 | | - |
29 | | -6) maybe edit README.txt in the wildfly-8.1.0.CR2.patch.zip |
30 | | - |
31 | | - |
32 | | - |
33 | | -### create template for one off or cumulative patch: |
34 | | - |
35 | | -`sh tool.sh --create-template --one-off my-custom-patch` |
36 | | - |
37 | | -`sh tool.sh --create-template --cumulative my-custom-patch` |
38 | | - |
39 | | -### compare distributions |
40 | | - |
41 | | -`sh tool.sh --applies-to-dist=/path/to/old/distribution --updated-dist=/path/to/new/distribution --patch-config=patch-config-my-custom-patch.xml --output-file=my-custom-patch.zip` |
| 57 | +3. Run the command specified in the Patch Generation section. |
| 58 | +4. Optionally, edit README.txt in the zip. |
| 59 | +``` |
| 60 | +unzip -qo patch.zip README.txt |
| 61 | +$EDITOR README.txt |
| 62 | +zip -qu patch.zip README.txt |
| 63 | +``` |
0 commit comments