freeipa / freeipa-openshift-container

FreeIPA container for OpenShift 4
5 stars 7 forks source link

idmocp-47: Script to check build using prci repository #2

Closed avisiedo closed 4 years ago

avisiedo commented 4 years ago

This change appends a helper script that allow build a container image using the repository generated from a pull request at freeipa ci. It only need the hash retrieved from the freeipa prci information, and the script do the rest.

I mean, Freeipa pipeline, which is based in Azure pipeline, has a delivery towards an object storage where the generated RPM files are sent. To access that public storage a hash from the Pull Request pipeline should be retrieved (no automation I have found for it yet, happy to hear about it if some idea arise). With that hash (don't confuse with the hash of the git commit), we set the environment variable ARTIFACT_HASH and launch the helper script. At this PR (https://github.com/freeipa/freeipa/pull/5054) we can find the hash when accessing the check details for the "build" item (that take us to the artifact page where the RPM files were pushed).

The helper script basically collect some information from the object storage web page, select the Dockerfile to be used (if some match is found), and create dynamically a temporary Dockerfile to use the RPM repo with the specified package repository. Finally launch the build process for that temporary Dockerfile.

Usage:

ARTIFACT_HASH="<copy_here_the_hash>" ./devel/check-container-build-with-prci.sh
frasertweedale commented 4 years ago

I'm fine with merging this as-is and improving it as needed. Currently the build does not work against master nightly due to patch conflicts (thanks to Christian's patches merged to master recently). But that is the not the fault of this script :)

@avisiedo if you are happy with it, let's merge it.

vashirov commented 4 years ago

lgtm, thanks!