feat(precheck): now includes a precheck for more generic runner execution
This commit is contained in:
24
ts/mod_precheck/index.ts
Normal file
24
ts/mod_precheck/index.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import * as paths from '../npmci.paths.js';
|
||||
import { logger } from '../npmci.logging.js';
|
||||
import { Npmci } from '../npmci.classes.npmci.js';
|
||||
|
||||
export const handleCli = async (npmciRefArg: Npmci, argvArg: any) => {
|
||||
logger.log('info', 'checking execution context');
|
||||
const presentRunnerTags = process.env.CI_RUNNER_TAGS.split(',').map((stringArg) =>
|
||||
stringArg.trim()
|
||||
);
|
||||
let allDesiredGitlabRunnerTagsPresent = true;
|
||||
for (const desiredRunnerTag of npmciRefArg.npmciConfig.getConfig().gitlabRunnerTags) {
|
||||
if (!presentRunnerTags.includes(desiredRunnerTag)) {
|
||||
allDesiredGitlabRunnerTagsPresent = false;
|
||||
logger.log(
|
||||
'error',
|
||||
`Desired runnerRag ${desiredRunnerTag} is missing in current execution context.`
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!allDesiredGitlabRunnerTagsPresent) {
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
1
ts/mod_precheck/plugins.ts
Normal file
1
ts/mod_precheck/plugins.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from '../npmci.plugins.js';
|
Reference in New Issue
Block a user