Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}