Skip to content

Commit 3cab308

Browse files
committed
chore: changes to be compatible with YLT v3
1 parent 4d43a79 commit 3cab308

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18.18.2

Dockerfile.lambda

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
FROM public.ecr.aws/lambda/nodejs:12
1+
FROM public.ecr.aws/lambda/nodejs:18-x86_64
22

33
ENV DOCKERIZED yes
4+
ENV PUPPETEER_CACHE_DIR /puppeteer-cache
45

56
RUN yum install -y \
67
git gcc make gcc-c++ zlib-devel libjpeg-turbo-devel nasm automake autoconf libtool \
@@ -27,8 +28,9 @@ RUN yum install -y \
2728

2829
ADD . /var/task
2930

30-
RUN rm -rf node_modules && \
31+
32+
RUN mkdir -p /puppeteer-cache && rm -rf node_modules && \
3133
npm install jpegoptim-bin --unsafe-perm=true --allow-root && \
32-
NODE_ENV=development && npm install --only=prod
34+
NODE_ENV=production && npm install --only=prod
3335

3436
CMD [ "lambda.runner" ]

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,27 @@ DOCKER_IMAGE_TAG ?= latest
55
RESULT_BUCKET_NAME ?= $(env)-yellowlabtools-storage
66
TEST_NAME ?= test-local
77
TEST_URL ?= https://www.google.fr
8+
RUNNER_SUFFIX ?=
89

910
all: install
1011

1112
install:
1213
@npm install
1314

1415
build-docker-image-lambda:
15-
@docker build -f Dockerfile.lambda -t yellowlabtools-runner-lambda .
16+
@docker build -f Dockerfile.lambda -t yellowlabtools-runner$(RUNNER_SUFFIX)-lambda .
1617

1718
tag-docker-image-lambda:
18-
@docker tag yellowlabtools-runner-lambda:$(DOCKER_IMAGE_TAG) $(DOCKER_REGISTRY)/yellowlabtools-runner-lambda:$(DOCKER_IMAGE_TAG)
19+
@docker tag yellowlabtools-runner$(RUNNER_SUFFIX)-lambda:$(DOCKER_IMAGE_TAG) $(DOCKER_REGISTRY)/yellowlabtools-runner$(RUNNER_SUFFIX)-lambda:$(DOCKER_IMAGE_TAG)
1920

2021
push-docker-image-lambda:
21-
@docker push $(DOCKER_REGISTRY)/yellowlabtools-runner-lambda:$(DOCKER_IMAGE_TAG)
22+
@docker push $(DOCKER_REGISTRY)/yellowlabtools-runner$(RUNNER_SUFFIX)-lambda:$(DOCKER_IMAGE_TAG)
2223

2324
login-docker:
2425
@AWS_PROFILE=$(AWS_PROFILE) aws ecr get-login-password --region $(AWS_REGION) | docker login --username AWS --password-stdin $(DOCKER_REGISTRY)
2526

2627
start-local-lambda:
27-
@docker run --rm -it -p 9000:8080 -e RESULT_BUCKET_NAME=$(RESULT_BUCKET_NAME) -e AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) -e AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) yellowlabtools-runner-lambda:$(DOCKER_IMAGE_TAG)
28+
@docker run --rm -it -p 9000:8080 -e RESULT_BUCKET_NAME=$(RESULT_BUCKET_NAME) -e AWS_ACCESS_KEY_ID=$(AWS_ACCESS_KEY_ID) -e AWS_SECRET_ACCESS_KEY=$(AWS_SECRET_ACCESS_KEY) yellowlabtools-runner$(RUNNER_SUFFIX)-lambda:$(DOCKER_IMAGE_TAG)
2829

2930
run-local-test:
3031
@curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"id": "$(TEST_NAME)", "url": "$(TEST_URL)"}'

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yellowlabtools-lambda-agent",
3-
"version": "1.0.0",
3+
"version": "3.0.0",
44
"description": "The AWS Lambda testing agent that's in use on https://yellowlab.tools",
55
"main": "lambda.js",
66
"scripts": {
@@ -17,7 +17,7 @@
1717
},
1818
"homepage": "https://github.com/YellowLabTools/YellowLabTools-lambda-agent#readme",
1919
"dependencies": {
20-
"aws-sdk": "2.904.0",
21-
"yellowlabtools": "2.1.0"
20+
"aws-sdk": "^2.1488.0",
21+
"yellowlabtools": "3.0.1"
2222
}
2323
}

0 commit comments

Comments
 (0)