content icon indicating copy to clipboard operation
content copied to clipboard

Account for non-existent 'build' dir in build_product

Open comps opened this issue 1 year ago • 5 comments

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'.

comps avatar Feb 19 '24 11:02 comps

Start a new ephemeral environment with changes proposed in this pull request:

Fedora Environment Open in Gitpod

Oracle Linux 8 Environment Open in Gitpod

github-actions[bot] avatar Feb 19 '24 11:02 github-actions[bot]

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

comps avatar Feb 19 '24 11:02 comps

/packit retest-failed

jan-cerny avatar Feb 19 '24 13:02 jan-cerny

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

I would go for the condition, less change to what we have today.

Mab879 avatar Feb 19 '24 15:02 Mab879

Swapped the code for a simple conditioned mkdir, adjusted the commit message appropriately.

comps avatar Feb 20 '24 06:02 comps

: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

github-actions[bot] avatar Feb 20 '24 06:02 github-actions[bot]

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.

qlty-cloud-legacy[bot] avatar Feb 20 '24 06:02 qlty-cloud-legacy[bot]