UNPKG

singularci

Version:

SingularCI is a DSL transpiler used to generate CI/CD configuration files for existing CI platforms

53 lines (46 loc) 1.07 kB
import IStage from './interfaces/IStage'; import { Service } from 'typedi'; import Job, { JobSyntaxType } from './Job'; export type StageSyntaxType = { name: string, runs_on: string, needs?: string[], jobs: JobSyntaxType[] } @Service({ id: "StageFactory" }) export default class StageFactory { createStage( stageName: string, jobs: Job[], needs: string[], runsOn: string ): IStage { return new Stage( stageName, jobs, needs, runsOn ); } } @Service({ id: "Stage" }) export class Stage implements IStage { constructor( private name: string, private jobs: Job[], private needs: string[], private runs_on: string ){} getName(): string{ return this.name; } getJobs(): Job[]{ return this.jobs; } getNeeds(): string[] { return this.needs; } getRunsOn(): string{ return this.runs_on; } }