Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
- name: run depcheck
id: rundepcheck
run: |
DEPCHECK=$(npx depcheck --ignores=depcheck --json) || true
echo "DEPCHECK_RESULT=$DEPCHECK" >> $GITHUB_ENV
DEPCHECK=$(npx depcheck --ignores=depcheck,chai,ts-node,typescript,aws-cdk-lib,@babel/core,@babel/preset-env,@types/node --json) || true
echo "DEPCHECK_RESULT=$DEPCHECK" >> $GITHUB_ENV
- name: Generate PR comment
id: generate_pr_comment
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
API_URL: ${{ secrets.API_URL }}
TOPIC_ARN: ${{ secrets.TOPIC_ARN }}


jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -32,14 +33,14 @@ jobs:

- uses: actions/setup-node@v2
with:
node-version: "18"
node-version: "22"

- name: Install CDK
run: |
npm install -g aws-cdk@2.25.0
npm install -g aws-cdk@latest

- name: Deploy stack
working-directory: ./cdk
working-directory: .
run: |
npm install
npm ci
cdk deploy openaq-fetcher --require-approval never
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ src/package.json
src/node_modules
cdk/cdk.out
/docs/adapter-update.md
/cdk.out/
3 changes: 1 addition & 2 deletions cdk/cdk.json → cdk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app": "npx ts-node --esm --prefer-ts-exts app.ts",
"app": "npx ts-node --prefer-ts-exts cdk/app.ts",
"watch": {
"include": [
"**"
Expand Down Expand Up @@ -41,4 +41,3 @@
"@aws-cdk/customresources:installLatestAwsSdkDefault": false
}
}

4 changes: 2 additions & 2 deletions cdk/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { RealtimeFetcherStack } from './stack';

const DOTENV = process.env.DOTENV || '.env';

const envs = readFileSync(`../src/${DOTENV}`, 'utf8');
const envs = readFileSync(`./src/${DOTENV}`, 'utf8');

interface keyable {
[key: string]: string
[key: string]: string
}

const env: keyable = {
Expand Down
16 changes: 6 additions & 10 deletions cdk/stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ export class RealtimeFetcherStack extends cdk.Stack {
) {
super(scope, id, props);
// add the package.json file
copyFileSync('../package.json', '../src/package.json');
copyFileSync('./package.json', './src/package.json');
// add the node modules
const cmd = [
'yarn',
'--prod',
'--cwd ../src',
'--frozen-lockfile',
`--modules-folder ../src/node_modules`,
'npm ci',
].join(' ');
execSync(cmd);
env.QUEUE_NAME = `${id}-queue`;
Expand All @@ -56,10 +52,10 @@ export class RealtimeFetcherStack extends cdk.Stack {
`${id}-scheduler-lambda`,
{
description: `Scheduler for ${id}-fetcher`,
code: lambda.Code.fromAsset('../src'),
code: lambda.Code.fromAsset('./src', { exclude: ['.env*', '*.sh'] }),
handler: 'scheduler.handler',
memorySize: 128,
runtime: lambda.Runtime.NODEJS_18_X,
runtime: lambda.Runtime.NODEJS_22_X,
timeout: cdk.Duration.seconds(30),
environment: env,
}
Expand All @@ -70,10 +66,10 @@ export class RealtimeFetcherStack extends cdk.Stack {
`${id}-fetcher-lambda`,
{
description: `Fetcher for ${id}`,
code: lambda.Code.fromAsset('../src'),
code: lambda.Code.fromAsset('./src', { exclude: ['.env*', '*.sh'] }),
handler: 'fetch.handler',
memorySize: 2048,
runtime: lambda.Runtime.NODEJS_18_X,
runtime: lambda.Runtime.NODEJS_22_X,
timeout: cdk.Duration.seconds(900),
environment: env,
}
Expand Down
Loading