Skip to content

Commit

Permalink
chore(import): migrating braze-content-proxy into the monorepo (#696)
Browse files Browse the repository at this point in the history
* chore(import): initial import of braze-content-proxy from dfa8c6af2b1cbf455e7d39e38ff8f39ec1ecae12

* chore(cleanup): conforming braze content proxy to the patterns

* fix(tags): updating braze content proxy tags
  • Loading branch information
bassrock authored Aug 27, 2024
1 parent 25c37d9 commit d89b17c
Show file tree
Hide file tree
Showing 29 changed files with 3,221 additions and 3,221 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/braze-content-proxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Braze Content Proxy
on:
pull_request:
paths:
- 'infrastructure/braze-content-proxy/**'
- 'packages/**'
- 'servers/braze-content-proxy/**'
- 'pnpm-lock.yaml'
- 'Dockerfile'
- '.github/actions/**'
- '.github/workflows/braze-content-proxy.yml'
- '.github/workflows/reuse-*.yml'
push:
branches:
- main
- dev
paths:
- 'infrastructure/braze-content-proxy/**'
- 'packages/**'
- 'servers/braze-content-proxy/**'
- 'pnpm-lock.yaml'
- 'Dockerfile'
- '.github/actions/**'
- '.github/workflows/braze-content-proxy.yml'
- '.github/workflows/reuse-*.yml'
jobs:
test-integrations:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/reuse-test-integrations.yml
with:
scope: braze-content-proxy
secrets: inherit

infrastructure:
uses: ./.github/workflows/reuse-infrastructure.yml
with:
scope: braze-content-proxy-cdk
stack-output-path: infrastructure/braze-content-proxy/cdktf.out/stacks/braze-content-proxy
secrets: inherit

api:
uses: ./.github/workflows/reuse-build-and-push-image.yml
needs: [infrastructure]
with:
scope: braze-content-proxy
app-path: servers/braze-content-proxy
app-port: 4500
sentry-project: braze-content-proxy
docker-repo-name-pattern: brazecontentproxy-{0}-app
terraform-output: ${{needs.infrastructure.outputs.terraform-output}}
secrets: inherit

sentry:
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main'
uses: ./.github/workflows/reuse-sentry-release.yml
needs: [api]
with:
sentry-project: braze-content-proxy
sentry-environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'development' }}
secrets: inherit
1 change: 1 addition & 0 deletions infrastructure/braze-content-proxy/.terraform-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8.3
5 changes: 5 additions & 0 deletions infrastructure/braze-content-proxy/cdktf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"language": "typescript",
"app": "npm run --silent compile && node dist/main.js",
"projectId": "84da9c3f-9eea-4e71-890c-2c4d8f67d69e"
}
3 changes: 3 additions & 0 deletions infrastructure/braze-content-proxy/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import cdktf from '@pocket-tools/eslint-config/cdktf';
import tseslint from 'typescript-eslint';
export default tseslint.config(...cdktf);
33 changes: 33 additions & 0 deletions infrastructure/braze-content-proxy/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "braze-content-proxy-cdk",
"version": "1.0.0",
"private": true,
"license": "MPL-2.0",
"main": "dist/main.js",
"types": "dist/main.ts",
"scripts": {
"build": "rm -rf dist && tsc",
"compile": "tsc --pretty",
"format": "eslint --fix",
"lint": "eslint --fix-dry-run",
"synth": "cdktf synth",
"watch": "tsc -w"
},
"dependencies": {
"@cdktf/provider-aws": "19.31.0",
"@cdktf/provider-local": "10.1.0",
"@cdktf/provider-null": "10.0.0",
"@cdktf/provider-pagerduty": "13.11.4",
"@pocket-tools/terraform-modules": "workspace:*",
"cdktf": "0.20.8",
"cdktf-cli": "0.20.8",
"constructs": "10.3.0"
},
"devDependencies": {
"@pocket-tools/eslint-config": "workspace:*",
"@types/node": "^20.16",
"ts-node": "10.9.2",
"tsconfig": "workspace:*",
"typescript": "5.5.4"
}
}
36 changes: 36 additions & 0 deletions infrastructure/braze-content-proxy/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const name = 'BrazeContentProxy';
const domainPrefix = 'braze-content-proxy';
const isDev = process.env.NODE_ENV === 'development';
const environment = isDev ? 'Dev' : 'Prod';
const domain = isDev
? `${domainPrefix}.getpocket.dev`
: `${domainPrefix}.getpocket.com`;

export const config = {
name,
isDev,
prefix: `${name}-${environment}`,
circleCIPrefix: `/${name}/CircleCI/${environment}`,
shortName: 'BCP',
environment,
domain,
healthCheck: {
command: [
'CMD-SHELL',
'curl -f http://localhost:4500/.well-known/server-health || exit 1',
],
interval: 15,
retries: 3,
timeout: 5,
startPeriod: 0,
},
tags: {
service: name,
environment,
owner: 'Pocket',
costCenter: 'Pocket',
app_code: 'pocket',
component_code: `pocket-${name.toLowerCase()}`,
env_code: isDev ? 'dev' : 'prod',
},
};
Loading

0 comments on commit d89b17c

Please sign in to comment.