Skip to content

Commit

Permalink
[DOP-4334]: Add new build commands
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry committed Feb 29, 2024
1 parent 6faabe9 commit 9f08902
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
12 changes: 12 additions & 0 deletions cdk-infra/lib/constructs/api/webhook-api-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { getFeatureName } from '../../../utils/env';

const HANDLERS_PATH = path.join(__dirname, '/../../../../api/controllers/v2');

const memorySize = 1024;

const bundling: BundlingOptions = {
sourceMap: true,
minify: true,
Expand Down Expand Up @@ -46,6 +48,7 @@ export class WebhookApiConstruct extends Construct {
environment,
bundling,
timeout,
memorySize,
});

const slackDisplayRepoLambda = new NodejsFunction(this, 'slackDisplayRepoLambda', {
Expand All @@ -55,6 +58,7 @@ export class WebhookApiConstruct extends Construct {
environment,
bundling,
timeout,
memorySize,
});

const dochubTriggerUpsertLambda = new NodejsFunction(this, 'dochubTriggerUpsertLambda', {
Expand All @@ -63,6 +67,7 @@ export class WebhookApiConstruct extends Construct {
handler: 'UpsertEdgeDictionaryItem',
environment,
timeout,
memorySize,
});

const githubTriggerLambda = new NodejsFunction(this, 'githubTriggerLambda', {
Expand All @@ -72,6 +77,7 @@ export class WebhookApiConstruct extends Construct {
bundling,
environment,
timeout,
memorySize,
});

const githubDeleteArtifactsLambda = new NodejsFunction(this, 'githubDeleteArtifactsLambda', {
Expand All @@ -81,6 +87,7 @@ export class WebhookApiConstruct extends Construct {
bundling,
environment,
timeout,
memorySize,
});

const triggerLocalBuildLambda = new NodejsFunction(this, 'triggerLocalBuildLambda', {
Expand All @@ -90,6 +97,7 @@ export class WebhookApiConstruct extends Construct {
environment,
bundling,
timeout,
memorySize,
});

const handleJobsLambda = new NodejsFunction(this, 'handleJobsLambda', {
Expand All @@ -99,6 +107,7 @@ export class WebhookApiConstruct extends Construct {
environment,
bundling,
timeout,
memorySize,
});

const snootyBuildCompleteLambda = new NodejsFunction(this, 'snootyBuildCompleteLambda', {
Expand All @@ -108,6 +117,7 @@ export class WebhookApiConstruct extends Construct {
environment,
bundling,
timeout,
memorySize,
});
const testDeployLambda = new NodejsFunction(this, 'testDeployLambda', {
entry: `${HANDLERS_PATH}/test-deploy.ts`,
Expand All @@ -116,6 +126,7 @@ export class WebhookApiConstruct extends Construct {
environment,
bundling,
timeout,
memorySize,
});

// generic handler for the root endpoint
Expand All @@ -124,6 +135,7 @@ export class WebhookApiConstruct extends Construct {
runtime,
handler: 'RootEndpointLambda',
timeout,
memorySize,
});

const apiName = `webhookHandlers-${getFeatureName()}`;
Expand Down
3 changes: 2 additions & 1 deletion cdk-infra/lib/constructs/worker/worker-construct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { IQueue } from 'aws-cdk-lib/aws-sqs';
import { Construct } from 'constructs';
import path from 'path';
import { getEnv } from '../../../utils/env';
import { Platform } from 'aws-cdk-lib/aws-ecr-assets';

interface WorkerConstructProps {
dockerEnvironment: Record<string, string>;
Expand Down Expand Up @@ -69,9 +70,9 @@ export class WorkerConstruct extends Construct {
NPM_BASE_64_AUTH: dockerEnvironment.NPM_BASE_64_AUTH,
NPM_EMAIL: dockerEnvironment.NPM_EMAIL,
},

cacheFrom: [{ type: 'gha' }],
cacheTo: { type: 'gha', params: { mode: 'max' } },
platform: Platform.LINUX_AMD64,
};

const taskDefLogGroup = new LogGroup(this, 'workerLogGroup');
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"clean": "node maintain.js",
"build": "tsc",
"build:esbuild:cacheUpdater": "esbuild src/cache-updater/index.ts --bundle --platform=node --outdir=./dist/ --allow-overwrite --sourcemap",
"build:esbuild": "esbuild src/onDemandApp.ts --bundle --platform=node --outdir=./ --allow-overwrite --sourcemap",
"build:esbuild": "npm run build:esbuild:enhanced && npm run build:esbuild:onDemand",
"build:esbuild:onDemand": "esbuild src/onDemandApp.ts --bundle --platform=node --outdir=./ --allow-overwrite --sourcemap",
"build:esbuild:enhanced": "esbuild src/enhanced/enhancedApp.ts --bundle --platform=node --outdir=./enhanced --allow-overwrite --sourcemap",
"format": "npm run prettier -- --check",
"format:fix": "npm run prettier -- --write",
"lint": "eslint --ext .ts .",
Expand Down

0 comments on commit 9f08902

Please sign in to comment.