How to use the @aws-cdk/aws-codebuild.PipelineProject function in @aws-cdk/aws-codebuild

To help you get started, we’ve selected a few @aws-cdk/aws-codebuild 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 seagull-js / seagull / packages / pipeline / src / lib / cdk / stack.ts View on Github external
installCmds.push('npm i -g npm')
    installCmds.push('npm ci')
    buildCmds.push('npm run build')
    postBuildCmds.push('npm run test')
    const deployEnv = `BRANCH_NAME=${this.branchName} DEPLOY_MODE=${this.mode}`
    postBuildCmds.push(`${deployEnv} NO_PROFILE_CHECK=true npm run deploy`)

    const install = { commands: installCmds }
    const build = { commands: buildCmds }
    const postBuild = { commands: postBuildCmds }
    const phases = { build, install, post_build: postBuild }
    const buildSpec = { phases, version: '0.2' }
    const role = this.role
    const projectConfig = { buildSpec, environment, role }
    const project = new CB.PipelineProject(this, 'BuildProject', projectConfig)
    const stage = this.pipeline.addStage('BuildStage', { placement })
    const buildProps = { project, stage }
    // tslint:disable-next-line:no-unused-expression
    new CB.PipelineBuildAction(this, 'CodeBuild', buildProps)
  }
github cloudcomponents / cdk-components / examples / codepipeline-slack-approval-example / src / codepipeline-slack-approval-stack.ts View on Github external
super(parent, name, props);

        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,
github fourTheorem / slic-starter / cicd / lib / stages / check-changes-stage.ts View on Github external
constructor(scope: Construct, resources: any) {
    super(scope, 'checkChanges')

    resources.checkChangesProject = new PipelineProject(
      scope,
      'CheckChangesProject',
      {
        buildSpec: {
          version: '0.2',
          phases: {
            build: {
              commands: [
                `bash ./build-scripts/check-changes.sh https://github.com/${
                  config.sourceRepoOwner
                }/${
                  config.sourceRepoName
                }.git $CODEBUILD_RESOLVED_SOURCE_VERSION`
              ]
            }
          },
github seagull-js / seagull / packages / deploy-aws / src / seagull_stack.ts View on Github external
addBuildActionStage(name: string, config: BuildStageConfig) {
    const stageName = name
    const projectName = `${this.id}-project-${name}`
    const { atIndex, pipeline } = config
    const projectConfig = this.createProjectConfig(config)
    const additionalOutputArtifactNames = this.getAdditionalOutputArtifactNames(
      name,
      config
    )
    const project = new CB.PipelineProject(this, projectName, projectConfig)
    const stage = pipeline.addStage(stageName, { placement: { atIndex } })
    const stageConfig = {
      additionalInputArtifacts: config.additionalInputArtifacts,
      additionalOutputArtifactNames,
      inputArtifact: config.inputArtifact,
      outputArtifactName: name,
      project,
      stage,
    }
    return new CB.PipelineBuildAction(this, name, stageConfig)
  }