How to use the @aws-cdk/aws-codebuild.LinuxBuildImage 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 humank / EventStormingWorkShop / deployment / coffeeshop-cdk / lib / coffee-shop-code-pipeline.ts View on Github external
//removalPolicy: cdk.RemovalPolicy.DESTROY, // NOT recommended for production code
        });

        coffeeShopBucket.grantPut(buildRole);
        coffeeShopBucket.grantRead(buildRole);
        coffeeShopBucket.grantReadWrite(buildRole);
        coffeeShopBucket.grantWrite(buildRole);

        new codebuild.Project(this, 'CodeBuildProject', {
            role: buildRole,
            source: defaultSource,
            // Enable Docker AND custom caching
            cache: codebuild.Cache.local(codebuild.LocalCacheMode.DOCKER_LAYER, codebuild.LocalCacheMode.CUSTOM),
            environment: {
                buildImage: codebuild.LinuxBuildImage.AMAZON_LINUX_2,
                privileged: true,
            },
            buildSpec: codebuild.BuildSpec.fromObject({
                version: '0.2',
                phases: {
                    install:{
                        'runtime-versions': {
                            java: 'corretto8'
                        }
                    },
                    build: {
                        commands: [
                            'echo "Build all modules"',
                            'echo "Run Maven clean install to have all the required jars in local .m2 repository"',
                            'cd sources/coffeeshop',
                            'mvn clean install -Dmaven.test.skip=true'
github seagull-js / seagull / packages / deploy-aws / src / seagull_stack.ts View on Github external
private createProjectConfig(config: BuildStageConfig) {
    const allowedComputeTypeSizes = ['SMALL', 'MEDIUM', 'LARGE']
    const { build, env, install, postBuild, role } = config
    const buildImage = CB.LinuxBuildImage.UBUNTU_14_04_NODEJS_8_11_0
    const computeType = allowedComputeTypeSizes.includes(config.computeTypeSize)
      ? `BUILD_GENERAL1_${config.computeTypeSize}`
      : CB.ComputeType.Small
    const phases = { build, install, post_build: postBuild }

    return {
      buildSpec: {
        artifacts: config.outputArtifacts,
        env,
        phases,
        version: '0.2',
      },
      environment: { buildImage, computeType },
      environmentVariables: mapEnvironmentVariables(env.variables),
      role,
    } as CB.ProjectProps
github seagull-js / seagull / packages / pipeline / src / lib / cdk / stack.ts View on Github external
private addBuildStage() {
    const placement = { atIndex: 1 }
    const buildImage = CB.LinuxBuildImage.UBUNTU_14_04_NODEJS_8_11_0
    const environment = { buildImage }
    const installCmds = []
    const buildCmds = []
    const postBuildCmds = []

    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 }