createE2EPipeline()

in hybrid-nodes-cdk/lib/nodeadm-stack.ts [367:421]


  createE2EPipeline() {
    if (this.nodeadmBuildOutput === undefined) {
      throw new Error('`nodeadmBuildOutput` is not defined');
    }
    if (this.nodeadmBuildAction === undefined) {
      throw new Error('`nodeadmBuildAction` is not defined');
    }
    if (this.ecrCacheAction === undefined) {
      throw new Error('`ecrCacheAction` is not defined');
    }
    if (this.cleanupAction === undefined) {
      throw new Error('`cleanupAction` is not defined');
    }
    if (this.githubSourceAction === undefined) {
      throw new Error('`githubSourceAction` is not defined');
    }
    if (this.integrationTestProject === undefined) {
      throw new Error('`integrationTestProject` is not defined');
    }
    if (this.nodeadmVersionVariable === undefined) {
      throw new Error('`nodeadmVersionVariable` is not defined');
    }

    const e2eTestsActions: Array<codepipeline_actions.CodeBuildAction> = [];
    for (const kubeVersion of constants.kubernetesVersions) {
      for (const cni of constants.cnis) {
        let additionalEnvironmentVariables = {};
        if (constants.betaKubeVersions.includes(kubeVersion)) {
          additionalEnvironmentVariables = this.betaEnvironmentVariables();
        }
        const e2eTestsAction = createTestAction(
          kubeVersion,
          cni,
          this.nodeadmBuildOutput,
          this.integrationTestProject,
          additionalEnvironmentVariables,
        );
        e2eTestsActions.push(e2eTestsAction);
      }
    }

    // Create the CodePipeline with the private GitHub source
    const e2ePipeline = createNodeadmE2EPipeline(
      this,
      'e2e-tests',
      this.githubSourceAction,
      this.nodeadmBuildAction,
      this.cleanupAction,
      this.ecrCacheAction,
      e2eTestsActions,
      [this.nodeadmVersionVariable],
    );

    this.addStandardLifecycleRules(e2ePipeline.artifactBucket as s3.Bucket);
  }