diff --git a/src/commands/agent/interactive/deploy.ts b/src/commands/agent/interactive/deploy.ts index aa004e9..74ac06c 100644 --- a/src/commands/agent/interactive/deploy.ts +++ b/src/commands/agent/interactive/deploy.ts @@ -16,6 +16,7 @@ export async function deployAgent( client: XpanderClient, _agentId?: string, skipDeploymentConfirmation: boolean = false, + skipLocalTests: boolean = false, ) { console.log('\n'); console.log(chalk.bold.blue('✨ Agent deployment')); @@ -78,6 +79,7 @@ export async function deployAgent( deploymentSpinner, currentDirectory, config.agent_id, + skipLocalTests, ); if (!imagePath) { diff --git a/src/commands/deploy.ts b/src/commands/deploy.ts index 8236a1c..4f87762 100644 --- a/src/commands/deploy.ts +++ b/src/commands/deploy.ts @@ -14,6 +14,7 @@ export function configureDeployCommand(program: Command): Command { .description('Deploy agent') .option('--profile ', 'Profile to use') .option('--confirm', 'Skip confirmation prompts') + .option('--skip-local-tests', 'Skip local Docker container tests') .action(async (agentId, options) => { const client = createClient(options.profile); @@ -25,7 +26,12 @@ export function configureDeployCommand(program: Command): Command { return; } - await deployAgent(client, resolvedAgentId, options.confirm); + await deployAgent( + client, + resolvedAgentId, + options.confirm, + options.skipLocalTests, + ); }); return operationsCmd; diff --git a/src/utils/custom_agents_utils/docker.ts b/src/utils/custom_agents_utils/docker.ts index 37221cf..fe6ad46 100644 --- a/src/utils/custom_agents_utils/docker.ts +++ b/src/utils/custom_agents_utils/docker.ts @@ -64,12 +64,14 @@ const ensureDockerRunning = async ( * * @param contextPath - Path to the Docker build context (directory with Dockerfile). * @param imageName - Name for the Docker image. + * @param skipLocalTests - If true, skip local Docker container tests. * @returns Full path to the resulting .tar.gz archive. */ export const buildAndSaveDockerImage = async ( deploymentSpinner: ora.Ora, contextPath: string, imageName: string, + skipLocalTests: boolean = false, ): Promise => { const resolvedContext = path.resolve(contextPath); const fullImageName = `${imageName}:latest`; @@ -101,10 +103,14 @@ export const buildAndSaveDockerImage = async ( resolvedContext, ]); - // Test the image locally before proceeding with export - const testPassed = await testDockerImage(deploymentSpinner, imageName, 10); - if (!testPassed) { - return; + // Test the image locally before proceeding with export (unless skipped) + if (!skipLocalTests) { + const testPassed = await testDockerImage(deploymentSpinner, imageName, 10); + if (!testPassed) { + return; + } + } else { + deploymentSpinner.text = 'Skipping local tests (--skip-local-tests flag)'; } deploymentSpinner.text = 'Exporting your AI Agent files';