25 lines
868 B
TypeScript
25 lines
868 B
TypeScript
import * as plugins from './plugins.ts';
|
|
import * as paths from '../szci.paths.ts';
|
|
import { logger } from '../szci.logging.ts';
|
|
import { Szci } from '../szci.classes.szci.ts';
|
|
|
|
export const handleCli = async (szciRefArg: Szci, argvArg: any) => {
|
|
logger.log('info', 'checking execution context');
|
|
const presentRunnerTags = Deno.env.get("CI_RUNNER_TAGS").split(',').map((stringArg) =>
|
|
stringArg.trim()
|
|
);
|
|
let allDesiredGitlabRunnerTagsPresent = true;
|
|
for (const desiredRunnerTag of szciRefArg.npmciConfig.getConfig().gitlabRunnerTags) {
|
|
if (!presentRunnerTags.includes(desiredRunnerTag)) {
|
|
allDesiredGitlabRunnerTagsPresent = false;
|
|
logger.log(
|
|
'error',
|
|
`Desired runnerRag ${desiredRunnerTag} is missing in current execution context.`
|
|
);
|
|
}
|
|
}
|
|
if (!allDesiredGitlabRunnerTagsPresent) {
|
|
Deno.exit(1);
|
|
}
|
|
};
|