content
content copied to clipboard
Account for non-existent 'build' dir in build_product
Description:
In some cases, especially when built as an RPM, the empty 'build' directory may disappear, causing ./build_product to fail on
./build_product: line 395: cd: build: No such file or directory
Since we're already removing its content, just remove it completely and re-create it from scratch. The -f of rm causes it to silently ignore non-existent 'build'.
Start a new ephemeral environment with changes proposed in this pull request:
I guess this would break the build/.gitkeep file that currently exists - issuing ./build_product would consider the file as deleted.
Would it be acceptable to just delete build by default? ... Or should I add touch build/.gitkeep to build_product?
Or to condition the mkdir instead?
[ -d build ] || mkdir build
/packit retest-failed
I guess this would break the
build/.gitkeepfile that currently exists - issuing./build_productwould consider the file as deleted.Would it be acceptable to just delete
buildby default? ... Or should I addtouch build/.gitkeeptobuild_product?Or to condition the
mkdirinstead?[ -d build ] || mkdir build
I would go for the condition, less change to what we have today.
Swapped the code for a simple conditioned mkdir, adjusted the commit message appropriately.
:robot: A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:11606
Click here to see how to deploy it
If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:11606
Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:11606 make deploy-local
Code Climate has analyzed commit f73a444d and detected 0 issues on this pull request.
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 58.3% (0.0% change).
View more on Code Climate.