Skip to content
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
7 changes: 5 additions & 2 deletions src/configs/emulator.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as z from 'zod';
import {DEPLOY_LOCAL_REPLICA_PATH} from '../constants/dev.constants';
import {EMULATOR_SKYLAB} from '../constants/emulator.constants';
import {ENV} from '../env';
import type {CliEmulatorConfig} from '../types/emulator';
import {type CliEmulatorConfig} from '../types/emulator';
import {readPackageJson} from '../utils/pkg.utils';
import {junoConfigExist, readJunoConfig} from './juno.config';

Expand Down Expand Up @@ -45,6 +45,8 @@ export const readEmulatorConfig = async (): Promise<
`${hostname}:${destination}`
);

const image = config.runner?.image ?? `junobuild/${emulatorType}:latest`;

return {
success: true,
config: {
Expand All @@ -54,7 +56,8 @@ export const readEmulatorConfig = async (): Promise<
emulatorType,
runner,
targetDeploy,
extraHosts
extraHosts,
image
}
}
};
Expand Down
4 changes: 1 addition & 3 deletions src/services/emulator/_runner.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const initConfigFile = async () => {
const startEmulator = async ({config: extendedConfig}: {config: CliEmulatorConfig}) => {
const {
config,
derivedConfig: {emulatorType, containerName, runner, targetDeploy, extraHosts}
derivedConfig: {emulatorType, containerName, runner, targetDeploy, extraHosts, image}
} = extendedConfig;

const {running} = await assertContainerRunning({containerName, runner});
Expand Down Expand Up @@ -217,8 +217,6 @@ const startEmulator = async ({config: extendedConfig}: {config: CliEmulatorConfi
// Podman does not auto create the path folders.
await createDeployTargetDir({targetDeploy});

const image = config.runner?.image ?? `junobuild/${emulatorType}:latest`;

const platform = config.runner?.platform;

await execute({
Expand Down
4 changes: 4 additions & 0 deletions src/types/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ export type EmulatorRunnerType = EmulatorRunner['type'];

export type EmulatorConfigWithoutConsole = Exclude<EmulatorConfig, {console: EmulatorConsole}>;

// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
export type EmulatorImage = `junobuild/${EmulatorType}:latest` | string;

export interface CliEmulatorDerivedConfig {
containerName: string;
runner: EmulatorRunnerType;
emulatorType: EmulatorType;
targetDeploy: string;
extraHosts: string[];
image: EmulatorImage;
}

export interface CliEmulatorConfig {
Expand Down
Loading