Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
} catch ( err ) {
// Some commit refs need to be set as detached.
await repo.setHeadDetached( ref );
}
spinner.text = `Downloading WordPress@${ ref } 100/100%.`;
spinner.text = `Starting WordPress@${ ref }.`;
fs.writeFileSync(
dockerComposeOptions.config,
createDockerComposeConfig( cwd, cwdName, cwdTestsPath, context )
);
// These will bring up the database container,
// because it's a dependency.
await dockerCompose.upMany(
[ 'wordpress', 'tests-wordpress' ],
dockerComposeOptions
);
const retryableSiteSetup = async () => {
try {
await Promise.all( [ setupSite(), setupSite( true ) ] );
} catch ( err ) {
await wait( 5000 );
throw err;
}
};
// Try a few times, in case
// the database wasn't ready.
await retryableSiteSetup()
.catch( retryableSiteSetup )