mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore(docker): make sure failed commands exit with non-zero code (#17863)
This commit is contained in:
parent
a23ee6f14d
commit
9a12ae9890
@ -286,6 +286,7 @@ export function addDockerCLI(program: Command) {
|
|||||||
await buildPlaywrightImage();
|
await buildPlaywrightImage();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.stack ? e : e.message);
|
console.error(e.stack ? e : e.message);
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -296,6 +297,7 @@ export function addDockerCLI(program: Command) {
|
|||||||
await startPlaywrightContainer();
|
await startPlaywrightContainer();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.stack ? e : e.message);
|
console.error(e.stack ? e : e.message);
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -306,6 +308,7 @@ export function addDockerCLI(program: Command) {
|
|||||||
await stopAllPlaywrightContainers();
|
await stopAllPlaywrightContainers();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.stack ? e : e.message);
|
console.error(e.stack ? e : e.message);
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -316,11 +319,12 @@ export function addDockerCLI(program: Command) {
|
|||||||
await deletePlaywrightImage();
|
await deletePlaywrightImage();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e.stack ? e : e.message);
|
console.error(e.stack ? e : e.message);
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dockerCommand.command('install-server-deps', { hidden: true })
|
dockerCommand.command('install-server-deps', { hidden: true })
|
||||||
.description('delete docker image, if any')
|
.description('install run-server dependencies')
|
||||||
.action(async function() {
|
.action(async function() {
|
||||||
const { code } = await spawnAsync('bash', [path.join(__dirname, '..', '..', 'bin', 'container_install_deps.sh')], { stdio: 'inherit' });
|
const { code } = await spawnAsync('bash', [path.join(__dirname, '..', '..', 'bin', 'container_install_deps.sh')], { stdio: 'inherit' });
|
||||||
if (code !== 0)
|
if (code !== 0)
|
||||||
@ -328,7 +332,7 @@ export function addDockerCLI(program: Command) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
dockerCommand.command('run-server', { hidden: true })
|
dockerCommand.command('run-server', { hidden: true })
|
||||||
.description('delete docker image, if any')
|
.description('run playwright server')
|
||||||
.action(async function() {
|
.action(async function() {
|
||||||
await spawnAsync('bash', [path.join(__dirname, '..', '..', 'bin', 'container_run_server.sh')], { stdio: 'inherit' });
|
await spawnAsync('bash', [path.join(__dirname, '..', '..', 'bin', 'container_run_server.sh')], { stdio: 'inherit' });
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user