Each month, the group I work for publishes new CentOS and Red Hat AMIs (and Azure templates and Vagrant boxes). When we complete the publication-event, we post a news announcement to our user-portal so that subscribers can receive an alert of the new publication. Included in that news announcement is a "what's changed" section.
In prior months, figuring out "what changed" was left as a manual step for the team-member charged with running the automation for a given month's publication event. This month, no one generated that news article and there were several updated and new RPMs included in the new image. So, I set about figuring out "how to extract this information programmatically so as to more-easily suss-out what to include in the announcement posting." The following does so (though, presumably, in a not-particularly-optimized) fashion:
git diff $( git log --pretty='%H' --follow -- <PATH_TO_MANIFEST_FILE> | \ head -2 | \ tac | \ sed 'N;s/\n/../' ) -- <PATH_TO_MANIFEST_FILE> | \ grep -E '(amazon|aws|ec2)-' | \ sed 's/^./& /' | \ sort -k 2
git logto output the commit-hashes for all the commits for the target file (in this case, the project's manifest-file)
head -2to grab only the two most-recent commit hashes from the output-stream
- Use the
taccommand to invert the order of the two lines returned from the
- Use the
sedcommand to join the two lines, replacing the first line's line-ending newline character with "
git diffagainst the output created in steps 1-4, and constrain the diff-activity to just the manifest-file.
- Pipe that output through
grepto suppress all information other than the bits containing the
- Pipe that through
sedso that the +/- that
git diffuses to show new and removed files, respectively, becomes an easily-tokenized substring.
- Sort the remaining output-stream (with
sort) so that the lines are groups by manifest-element (the second key/token in the sorted output)
Taking that output and converting to a news article is still manual, but it at least makes it a lot easier to do than either hand-diffing two files or having to "just know" what's changed.
Because Red Hat has placed EL6 is in its final stage of de-support, we've stopped publishing images for CentOS6 and RHEL6. We did this to discourage our subscribers from doing new deployments on EL6 (since the underlying OS will go into final de-support come November of this year).
Similarly, due to current lack of CentOS offering for EL8, lack of security-related build- or hardening-guidance for EL8 and associated lack of subscriber-demand for an EL8 build, we don't yet include builds for CentOS8 or RHEL8 in our process. Thus, for the time being, we only need to provide a "whats changed" for EL7 builds. Given this, (combined with the 99% overlap we implement in our CentOS vice RHEL builds) we currently only need to do change-queries against the "