How to use the @aws-cdk/aws-codebuild.BuildSpec.fromObject 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 jeshan / scale-your-cloudformation / lib / pipeline-construct.js View on Github external
let project = new Project(this, 'deploy-site', {
            description: 'Deploys website at scaleyourcloudformation.com',
            timeout: Duration.minutes(30),
            badge: true,
            source: Source.gitHub({
                cloneDepth: 1,
                owner: 'jeshan',
                repo: 'scale-your-cloudformation',
                webhookFilters: [
                    FilterGroup.inEventOf([EventAction.PUSH]).andBranchIs(
                        'master',
                    ),
                ],
            }),
            environment: { buildImage: LinuxBuildImage.STANDARD_2_0 },
            buildSpec: BuildSpec.fromObject({
                version: '0.2',
                phases: {
                    install: {
                        'runtime-versions': {
                            nodejs: '10',
                        },
                    },
                    pre_build: {
                        commands: ['npm i -g aws-cdk@1.16.3', 'npm i'],
                    },
                    build: {
                        commands: [
                            'cdk bootstrap',
                            'cdk diff || true',
                            'cdk deploy',
                        ],
github fourTheorem / slic-starter / cicd / lib / projects / module-build-project.ts View on Github external
constructor(scope: Construct, id: string, props: ModuleBuildProjectProps) {
    super(scope, id, {
      projectName: id,
      environment: defaultEnvironment,
      environmentVariables: projectEnvironmentVars,
      buildSpec: BuildSpec.fromObject({
        version: '0.2',
        phases: {
          install: {
            ...defaultRuntimes
          },
          pre_build: {
            commands: ['bash ./build-scripts/audit-module.sh']
          },
          build: {
            commands: ['bash ./build-scripts/build-module.sh']
          },
          post_build: {
            commands: ['bash ./build-scripts/package-module.sh']
          }
        },
        artifacts: moduleArtifacts
github fourTheorem / slic-starter / cicd / lib / projects / source-project.ts View on Github external
repo: config.sourceRepoName,
      webhook: true,
      webhookFilters: [
        FilterGroup.inEventOf(EventAction.PUSH).andBranchIs(config.sourceBranch)
      ]
    })

    const artifacts = Artifacts.s3({
      bucket: props.bucket,
      name: SLIC_PIPELINE_SOURCE_ARTIFACT,
      includeBuildId: false,
      packageZip: true
    })

    super(scope, id, {
      buildSpec: BuildSpec.fromObject({
        version: '0.2',
        phases: {
          install: {
            ...defaultRuntimes,
            commands: ['npm install']
          },
          build: {
            commands: [
              `bash ./build-scripts/source-kickoff.sh https://github.com/${config.sourceRepoOwner}/${config.sourceRepoName}.git $CODEBUILD_RESOLVED_SOURCE_VERSION`
            ]
          }
        },
        artifacts: {
          files: '**/*'
        }
      }),
github fourTheorem / slic-starter / cicd / lib / projects / orchestrator-deploy-project.ts View on Github external
projectName: `${props.stageName}DeployProject`,
      environmentVariables: {
        SLIC_STAGE: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: props.stageName
        },
        CROSS_ACCOUNT_ID: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: `${config.accountIds[props.stageName]}`
        },
        MODULE_NAMES: {
          type: BuildEnvironmentVariableType.PLAINTEXT,
          value: modules.moduleNames.join(' ')
        }
      },
      buildSpec: BuildSpec.fromObject({
        version: '0.2',
        phases: {
          build: {
            commands: ['bash ./build-scripts/orchestrator-stage-deploy.sh']
          }
        }
      }),
      ...rest
    })
  }
}
github fourTheorem / slic-starter / cicd / lib / projects / module-deploy-project.ts View on Github external
constructor(scope: Construct, id: string, props: ModuleDeployProjectProps) {
    super(scope, id, {
      projectName: id,
      role: props.role,
      environment: defaultEnvironment,
      environmentVariables: projectEnvironmentVars,
      buildSpec: BuildSpec.fromObject({
        version: '0.2',
        phases: {
          install: {
            ...defaultRuntimes
          },
          build: {
            commands: ['bash ./build-scripts/deploy-module.sh']
          }
        },
        artifacts: moduleArtifacts
      })
    })
  }
}