Skip to content

Commit

Permalink
dockerfile seemingly working
Browse files Browse the repository at this point in the history
  • Loading branch information
armandobelardo committed Oct 2, 2024
1 parent 738efae commit d7b2e6d
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 99 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy-fern-bot-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
uses: ./.github/actions/install

- name: Compile
run: pnpm compile
run: |
pnpm compile
pnpm --filter=@fern-platform/fern-bot compile:github-webhook
- name: 🚀 serverless deploy
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy-fern-bot-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
uses: ./.github/actions/install

- name: Compile
run: pnpm compile
run: |
pnpm compile
pnpm --filter=@fern-platform/fern-bot compile:github-webhook
- name: 🚀 serverless deploy
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-fern-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
npm install -g fern-api
- name: Compile and build
run: pnpm turbo compile codegen build
run: |
pnpm turbo compile codegen build
pnpm --filter=@fern-platform/fern-bot compile:github-webhook
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
WORKOS_API_KEY: ${{ secrets.WORKOS_API_KEY }}
Expand Down
102 changes: 14 additions & 88 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions servers/fern-bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN set -ex; pip install --no-cache-dir poetry;

# TypeScript (as this is a Node base image, npm and Node are already present!)
RUN npm install --global yarn
RUN npm install --global pnpm

# Go
RUN yum -y install golang
Expand Down Expand Up @@ -47,6 +48,7 @@ RUN ruby --version
# Copy all of the functions into the lambda, allowing us to reuse this image if needed
ENV LAMBDA_TASK_ROOT=/var/task
RUN mkdir -p ${LAMBDA_TASK_ROOT}
COPY ./lib/githubWebhookListener.js ${LAMBDA_TASK_ROOT}/githubWebhookListener.js
COPY ./lib/src ${LAMBDA_TASK_ROOT}/src
COPY ./node_modules ${LAMBDA_TASK_ROOT}/node_modules

Expand Down
14 changes: 11 additions & 3 deletions servers/fern-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"scripts": {
"compile": "tsc --build",
"compile:github-webhook": "esbuild --bundle --target=node18 --platform=node src/functions/github-webhook-listener/githubWebhookListener.ts --outfile=lib/githubWebhookListener.js",
"package": "sls package",
"release": "sls deploy",
"invoke": "sls invoke",
Expand All @@ -17,6 +18,12 @@
"engines": {
"node": ">=14.15.0"
},
"_moduleAliases": {
"@functions": "lib/src/functions",
"@generated": "lib/src/generated",
"@libs": "lib/src/libs",
"@utils": "lib/src/utils"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.335.0",
"@fern-api/core-utils": "0.15.0-rc63",
Expand All @@ -33,6 +40,7 @@
"find-up": "^7.0.0",
"js-yaml": "^4.1.0",
"json-2-csv": "^5.5.1",
"module-alias": "^2.2.3",
"octokit": "^3.2.0",
"semver": "^7.6.2",
"serverless-step-functions": "^3.21.0",
Expand All @@ -49,16 +57,16 @@
"@types/aws-lambda": "^8.10.71",
"@types/js-yaml": "^4.0.9",
"@types/node": "^18.7.18",
"@types/semver": "^7.5.8",
"@types/url-join": "4.0.1",
"esbuild": "0.20.2",
"esbuild": "0.24.0",
"json-schema-to-ts": "^1.5.0",
"serverless": "^3.0.0",
"serverless-esbuild": "^1.23.3",
"ts-node": "^10.4.0",
"tsconfig-paths": "^3.9.0",
"typescript": "^4.1.3",
"vitest": "^1.5.0",
"@types/semver": "^7.5.8"
"vitest": "^1.5.0"
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion servers/fern-bot/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ functions:
image:
name: generator_languages_image
command:
- "src/functions/github-webhook-listener/githubWebhookListener.handler"
- "githubWebhookListener.handler"
entryPoint:
- "/lambda-entrypoint.sh"
events:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// import { evaluateEnv } from "@libs/env";
import { evaluateEnv } from "@libs/env";
import { handlerWrapper } from "@libs/handler-wrapper";
// import { handleIncomingRequest } from "./actions/githubWebhookListener";
import { handleIncomingRequest } from "./actions/githubWebhookListener";

const githubWebhookListener = async (event: unknown) => {
console.debug("Beginning scheduled run of `githubWebhookListener`, received event:", event);
// const env = evaluateEnv();
const env = evaluateEnv();
console.debug("Environment evaluated, continuing to actual action execution.");
// return await handleIncomingRequest(event as Request, env);
return await handleIncomingRequest(event as Request, env);
};

export const handler = handlerWrapper(githubWebhookListener);

0 comments on commit d7b2e6d

Please sign in to comment.