private createPipeline()

in source/repositories/compliant-framework-central-pipeline/lib/environment-pipeline-stack.ts [92:158]


  private createPipeline() {

    var stageOutputs: {
      [name: string]: codepipeline.Artifact;
    } = {}

    const pipeline = new codepipeline.Pipeline(this, 'rPipeline', {
      pipelineName: `compliant-framework-${this.props.pipelineName}`,
      artifactBucket: this.s3Bucket,
    });

    this.lambdas[cfw.COPY_CODECOMMIT_REPOSITORIES_TO_S3].grantInvoke(pipeline.role)

    if (this.props.environment.startsWith('alpha')) {
      pipeline.addStage({
        stageName: 'Source',
        actions: this.getAlphaSourceActions()
      });
      pipeline.addStage({
        stageName: 'Deploy-ExpandS3Sources',
        actions: this.getExpandS3SourcesActions()
      });
    }
    else {
      pipeline.addStage({
        stageName: 'Source',
        actions: this.getSourceActions()
      });
      pipeline.addStage({
        stageName: 'Deploy-CopySourceToS3',
        actions: this.getCopySourceToS3Actions()
      });
    }

    pipeline.addStage({
      stageName: 'Deploy-InitializeOrgUnits',
      actions: this.getInitializeOrganizationalUnitsActions()
    });

    var environmentActions = this.getEnvironmentActions(stageOutputs)
    pipeline.addStage({
      stageName: 'Deploy-Environment',
      actions: environmentActions
    });

    pipeline.addStage({
      stageName: 'Deploy-SecurityBaseline',
      actions: this.getSecurityBaselineActions()
    });

    for (var item in this.props.config.plugins) {
      var stageName = 'Deploy-Plugin-' + item.toUpperCase()
      var actions: codepipeline.IAction[] = this.getPluginActions(item, stageOutputs, environmentActions)
      pipeline.addStage({
        stageName,
        actions
      });
    }

    if (this.props.config.federation.enabled) {
      pipeline.addStage({
        stageName: 'Deploy-FederationSupport',
        actions: this.getFederationSupportActions()
      });
    }

  }