-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation on how to build a hotfix #505
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,44 @@ docker cp ${CONTAINER}:/root/BUILD/rpms/x86_64/ ./rpms/ | |
docker rm ${CONTAINER} | ||
``` | ||
|
||
## Building a Hotfix | ||
|
||
Sometimes it is necessary to apply a patch without rebuilding the whole release in order to | ||
deliver a fix quickly. This can be accomplished by building a hotfix rpm which will apply | ||
a series of patches. | ||
|
||
Create a patch file using `git format-patch` and copy to `rpm_spec/patches/`. You will have to modify the path to be relative to the RPM BUILDDIR. | ||
|
||
For example if we wanted to create a hotfix to apply a commit in radjabov `1286aa34992340cad7a0778df01a845f1772e561` we would run: | ||
```sh | ||
git format-patch 1286aa34992340cad7a0778df01a845f1772e561^..1286aa34992340cad7a0778df01a845f1772e561 | ||
``` | ||
|
||
Which will create a patch file: `0001-Merge-pull-request-23123-from-agrare-fix_miq_request.patch` | ||
|
||
Next we have to change the file location to match the RPM BUILDDIR, for a patch in the core rpm this will be e.g. `manageiq-core-18.0-1` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not totally sure what you did here. Can you show us a diff of the Yes, meta, a diff of a diff, but just trying to understand what was done here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We also need to mention that you should remove any spec files from the patches. |
||
|
||
``` | ||
diff --git a/manageiq-core-18.0-1/app/models/miq_provision_request_template.rb b/manageiq-core-18.0-1/app/models/miq_provision_request_template.rb | ||
index 621f20b7e7..f62f454ac5 100644 | ||
--- a/manageiq-core-18.0-1/app/models/miq_provision_request_template.rb | ||
+++ b/manageiq-core-18.0-1/app/models/miq_provision_request_template.rb | ||
``` | ||
|
||
This ensures that the hotfix patch will apply correctly when it is run. Then move that patch | ||
file to `rpm_spec/patches/` in the rpm_build repo. | ||
|
||
`docker build --pull --tag $USER/rpm_build:radjabov-hotfix .` | ||
|
||
Create a `BUILD/hotfix` directory and copy the .src.rpm for the release that you want to | ||
build a hotfix against, for example `manageiq-release-18.0-1.el9.src.rpm` | ||
|
||
```sh | ||
docker run --rm -v `pwd`/OPTIONS:/root/OPTIONS -v `pwd`/BUILD:/root/BUILD $USER/rpm_build:radjabov-hotfix build_hotfix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NOTE instead of a separate volume map for the hotfix dir it seemed easier to just map There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought we already had this documented, but maybe not. @bdunne Please review. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I didn't see any so this started as me just taking notes on what I had to do so we had something to reference in the future There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having the docker command here is helpful So much time goes between needing to build rpms that I often forget. Re: "I thought we already had this documented" On the mac, mapping the I remember putting together documentation on this a while back but people seemed to disagree on the best approach. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Oh did you have hotfix documentation? Or you mean documentation on how to build rpms on a mac? |
||
``` | ||
|
||
The rpms for the hotfix will be in `BUILD/rpms`. | ||
|
||
## Versioning | ||
|
||
Branch `morphy` == v13 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simpler: