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

fix(java): wrong gradle init #3778

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli/tools/java/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class JavaPrepareService extends BasePrepareService {
await createMavenSettings(this.pathSvc);
await createGradleSettings(this.pathSvc);

if (!(await this.pathSvc.toolEnvExists(this.name))) {
if (!(await this.pathSvc.toolEnvExists('gradle'))) {
// fix: Failed to load native library 'libnative-platform.so' for Linux amd64.
await this.pathSvc.exportToolEnv(
'gradle',
Expand Down
20 changes: 20 additions & 0 deletions test/java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,25 @@ RUN install-tool gradle
RUN install-tool maven


#--------------------------------------
# test: readonly
#--------------------------------------
FROM base AS test-readonly

RUN prepare-tool java

# fake reaonly
RUN set -ex; \
chmod -R g-w /opt/containerbase; \
chown -R root /opt/containerbase; \
rm -rf /tmp/containerbase; \
true

USER 12021

RUN ls -la /tmp
RUN containerbase-cli init tool java

#--------------------------------------
# final
#--------------------------------------
Expand All @@ -238,3 +257,4 @@ COPY --from=test-gradle-d /.dummy /.dummy
COPY --from=test-maven-a /.dummy /.dummy
COPY --from=test-others /.dummy /.dummy
COPY --from=test-latest-version /.dummy /.dummy
COPY --from=test-readonly /.dummy /.dummy
2 changes: 1 addition & 1 deletion tools/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TestCommand extends Command {
if (this.debug) {
shell.echo('Debug mode enabled');
env.CONTAINERBASE_DEBUG = '1';
env.BUILDKIT_PROGRESS = '1';
env.BUILDKIT_PROGRESS = 'plain';
}

if (this.logLevel) {
Expand Down
Loading