fix: ensure UI directory is created when building debian-dev image
Description
This PR fixes a build failure when running make build-on-debian-dev.
The debian-dev image build failed at:
[2/2] STEP 9/21: COPY --chown=nobody:root ui/ /usr/local/apisix/ui/
Error: building at STEP "COPY --chown=nobody:root ui/ /usr/local/apisix/ui/": checking on sources under "/var/tmp/libpod_builder971763380/build": copier: stat: "/ui": no such file or directorybecause the ui directory does not exist in the build context.
To resolve this, the build script now ensures that an (empty) ui directory is created before building the debian-dev image, so the COPY ui/ /usr/local/apisix/ui/ step always succeeds even when no UI assets are present.
Which issue(s) this PR fixes:
Fixes #
Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [ ] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change
- [x] I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)
Hi @sihyeonn, you can merge the latest main branch to make CI pass.
Hi @sihyeonn, you can merge the latest main branch to make CI pass.
Thank you for your review! But I still need 2 more reviews to merge 🥲 Merging is blocked!
The failed test appears to be unrelated to this change and has already been fixed in the main branch.
Hi @SkyeYoung, thanks for the review!
Yes, this is for use cases where the UI is not needed.
I use make build-on-debian-dev locally when testing just the gateway functionality without the UI, and the build fails at the COPY step when the ui directory doesn't exist.
Moving the UI build from the workflow into the Makefile as you suggested is one approach, but it would increase build time and complexity for development environments where the UI isn't necessary.
The current fix just creates an empty directory to allow builds to succeed without UI assets - it's a minimal change. Do you think there's a better approach to handle this?