Skip to content
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

Account for non-existent 'build' dir in build_product #11606

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

comps
Copy link
Collaborator

@comps comps commented Feb 19, 2024

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

Copy link

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@comps
Copy link
Collaborator Author

comps commented Feb 19, 2024

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

@jan-cerny
Copy link
Collaborator

/packit retest-failed

@Mab879
Copy link
Member

Mab879 commented Feb 19, 2024

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.

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

Fix this by simply creating the directory if it doesn't exist.

Signed-off-by: Jiri Jaburek <comps@nomail.dom>
@comps
Copy link
Collaborator Author

comps commented Feb 20, 2024

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

Copy link

🤖 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

Copy link

codeclimate bot commented Feb 20, 2024

Code Climate has analyzed commit f73a444 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.

@jan-cerny jan-cerny self-assigned this Feb 20, 2024
@jan-cerny jan-cerny added this to the 0.1.73 milestone Feb 20, 2024
@jan-cerny jan-cerny merged commit ba5a6da into ComplianceAsCode:master Feb 20, 2024
44 checks passed
@Mab879 Mab879 added the Infrastructure Our content build system label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants