How to use the @aws-cdk/aws-codepipeline-actions.CodeBuildAction function in @aws-cdk/aws-codepipeline-actions

To help you get started, we’ve selected a few @aws-cdk/aws-codepipeline-actions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudcomponents / cdk-components / examples / codepipeline-slack-approval-example / src / codepipeline-slack-approval-stack.ts View on Github external
const repository = new Repository(this, 'Repository', {
            repositoryName: 'MyRepositoryName',
            description: 'Some description.', // optional property
        });

        const sourceArtifact = new Artifact();

        const sourceAction = new CodeCommitSourceAction({
            actionName: 'CodeCommit',
            repository,
            output: sourceArtifact,
        });

        const project = new PipelineProject(this, 'MyProject');

        const buildAction = new CodeBuildAction({
            actionName: 'CodeBuild',
            project,
            input: sourceArtifact,
        });

        const slackBotToken = process.env.SLACK_BOT_TOKEN as string;
        const slackSigningSecret = process.env.SLACK_SIGNING_SECRET as string;
        const slackChannel = process.env.SLACK_CHANNEL as string;

        const approvalAction = new SlackApprovalAction({
            actionName: 'SlackApproval',
            slackBotToken,
            slackSigningSecret,
            slackChannel,
            externalEntityLink: 'http://cloudcomponents.org',
            additionalInformation:
github fourTheorem / slic-starter / cicd / lib / orchestrator-pipeline.ts View on Github external
addTestStage(sourceOutputArtifact: Artifact) {
    const integrationTestProject = new IntegrationTestProject(
      this,
      `IntegrationTests`,
      {
        stageName: StageName.stg
      }
    )

    const integrationTestOutputArtifact = new Artifact()
    const integrationTestAction = new CodeBuildAction({
      actionName: 'integration_tests',
      input: sourceOutputArtifact,
      outputs: [integrationTestOutputArtifact],
      project: integrationTestProject
    })

    const e2eTestProject = new E2ETestProject(this, `e2eTests`, {
      stageName: StageName.stg
    })

    const e2eTestOutputArtifact = new Artifact()
    const e2eTestAction = new CodeBuildAction({
      actionName: 'e2e_tests',
      input: sourceOutputArtifact,
      outputs: [e2eTestOutputArtifact],
      project: e2eTestProject
github fourTheorem / slic-starter / cicd / lib / stages / check-changes-stage.ts View on Github external
}/${
                  config.sourceRepoName
                }.git $CODEBUILD_RESOLVED_SOURCE_VERSION`
              ]
            }
          },
          artifacts: {
            files: '**/*'
          }
        },
        environment: defaultEnvironment,
        role: resources.codeBuildRole
      }
    )

    const checkChangesAction = new CodeBuildAction({
      actionName: 'check-changes',
      input: resources.sourceAction.output,
      output: new Artifact(),
      project: resources.checkChangesProject
    })

    resources.checkChangesAction = checkChangesAction
    resources.pipeline.addStage({
      name: 'check_changes',
      actions: [checkChangesAction]
    })
  }
}
github fourTheorem / slic-starter / cicd / lib / orchestrator-pipeline.ts View on Github external
addDeployStage(
    stageName: StageName,
    orchestratorCodeBuildRole: Role,
    sourceOutputArtifact: Artifact
  ) {
    const orchestratorDeployStagingProject = new OrchestratorDeployProject(
      this,
      `${stageName}OrchestratorDeploy`,
      {
        stageName,
        role: orchestratorCodeBuildRole
      }
    )

    const deployOutputArtifact = new Artifact()
    const deployAction = new CodeBuildAction({
      actionName: stageName,
      input: sourceOutputArtifact,
      outputs: [deployOutputArtifact],
      project: orchestratorDeployStagingProject
    })

    this.addStage({
      stageName: `${stageName}Deploy`,
      actions: [deployAction]
    })
  }
}
github fourTheorem / slic-starter / cicd / lib / module-pipeline.ts View on Github external
type: BuildEnvironmentVariableType.PLAINTEXT,
        value: `${config.defaultRegions[stageName]}`
      },
      SLIC_STAGE: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: stageName
      },
      MODULE_NAME: {
        type: BuildEnvironmentVariableType.PLAINTEXT,
        value: moduleName
      },
      ...projectEnvironmentVars
    }

    const moduleBuildOutputArtifact = new Artifact()
    const moduleBuildAction = new CodeBuildAction({
      actionName: 'Build',
      input: sourceOutputArtifact,
      outputs: [moduleBuildOutputArtifact],
      project: moduleBuildProject,
      role: pipelineRole,
      environmentVariables: environmentVars
    })

    this.addStage({
      stageName: 'Build',
      actions: [moduleBuildAction]
    })

    const moduleDeployOutputArtifact = new Artifact()
    const moduleDeployAction = new CodeBuildAction({
      actionName: 'Deploy',
github fourTheorem / slic-starter / cicd / lib / orchestrator-pipeline.ts View on Github external
)

    const integrationTestOutputArtifact = new Artifact()
    const integrationTestAction = new CodeBuildAction({
      actionName: 'integration_tests',
      input: sourceOutputArtifact,
      outputs: [integrationTestOutputArtifact],
      project: integrationTestProject
    })

    const e2eTestProject = new E2ETestProject(this, `e2eTests`, {
      stageName: StageName.stg
    })

    const e2eTestOutputArtifact = new Artifact()
    const e2eTestAction = new CodeBuildAction({
      actionName: 'e2e_tests',
      input: sourceOutputArtifact,
      outputs: [e2eTestOutputArtifact],
      project: e2eTestProject
    })

    this.addStage({
      stageName: 'Test',
      actions: [integrationTestAction, e2eTestAction]
    })
  }
github fourTheorem / slic-starter / cicd / lib / orchestrator-pipeline.ts View on Github external
new ManualApprovalAction({
          actionName: 'MoveToProduction'
        })
      ]
    })

    this.addDeployStage(
      StageName.prod,
      orchestratorCodeBuildRole,
      sourceOutputArtifact
    )

    this.addStage({
      stageName: 'UpdateDeploymentState',
      actions: [
        new CodeBuildAction({
          actionName: 'UpdateState',
          input: sourceOutputArtifact,
          project: new UpdateDeploymentStateProject(
            this,
            'updateDeploymentStateProject',
            {
              bucketName: this.artifactBucket.bucketName,
              role: sourceCodeBuildRole
            }
          )
        })
      ]
    })
  }