Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 323ec6a

Browse files
authored
Merge pull request #18 from triggermesh/master
Sync
2 parents ee01929 + 53ad6f6 commit 323ec6a

File tree

9 files changed

+75
-46
lines changed

9 files changed

+75
-46
lines changed

cloudbuild.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
steps:
2+
## Build python37 runtime
3+
- name: 'gcr.io/cloud-builders/docker'
4+
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-python37:$REVISION_ID', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-python37:latest', '-f' ,'./python-3.7/Dockerfile', '.' ]
5+
6+
## Build python27 runtime
7+
- name: 'gcr.io/cloud-builders/docker'
8+
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-python27:$REVISION_ID', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-python27:latest', '-f' ,'./python-2.7/Dockerfile', '.' ]
9+
10+
## Build node4 runtime
11+
- name: 'gcr.io/cloud-builders/docker'
12+
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-node4:$REVISION_ID', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-node4:latest', '-f' ,'./node-4.x/Dockerfile', '.' ]
13+
14+
## Build node10 runtime
15+
- name: 'gcr.io/cloud-builders/docker'
16+
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-node10:$REVISION_ID', '-t', 'gcr.io/$PROJECT_ID/knative-lambda-node10:latest', '-f' ,'./node-10.x/Dockerfile', '.' ]
17+
18+
images:
19+
- 'gcr.io/$PROJECT_ID/knative-lambda-python37'
20+
- 'gcr.io/$PROJECT_ID/knative-lambda-python27'
21+
- 'gcr.io/$PROJECT_ID/knative-lambda-node4'
22+
- 'gcr.io/$PROJECT_ID/knative-lambda-node10'

node-10.x/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:10-alpine
2+
WORKDIR /opt
3+
4+
RUN apk --no-cache add curl \
5+
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6+
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
8+
&& chmod +x aws-custom-runtime \
9+
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/node-10.x \
10+
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/node-10.x/* .
11+
12+
ENV LAMBDA_TASK_ROOT "/opt"

node-10.x/buildtemplate.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,7 @@ spec:
3838
- |
3939
cd /workspace/${DIRECTORY}
4040
cat <<EOF > Dockerfile
41-
FROM node:10-alpine
42-
WORKDIR /opt
43-
44-
RUN apk --no-cache add curl \
45-
&& API_VERSION=\$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
46-
&& RUNTIME_VERSION=\$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
47-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/\${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
48-
&& chmod +x aws-custom-runtime \
49-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/\${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-\${RUNTIME_VERSION}/node-10.x \
50-
&& mv knative-lambda-runtime-\${RUNTIME_VERSION}/node-10.x/* .
51-
52-
ENV LAMBDA_TASK_ROOT "/opt"
41+
FROM gcr.io/triggermesh/knative-lambda-node10
5342
ENV _HANDLER "${HANDLER}"
5443
5544
COPY . .

node-4.x/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:4-alpine
2+
WORKDIR /opt
3+
4+
RUN apk --no-cache add curl \
5+
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6+
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
8+
&& chmod +x aws-custom-runtime \
9+
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/node-4.x \
10+
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/node-4.x/* .
11+
12+
ENV LAMBDA_TASK_ROOT "/opt"

node-4.x/buildtemplate.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,7 @@ spec:
3838
- |
3939
cd /workspace/${DIRECTORY}
4040
cat <<EOF > Dockerfile
41-
FROM node:4-alpine
42-
WORKDIR /opt
43-
44-
RUN apk --no-cache add curl \
45-
&& API_VERSION=\$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
46-
&& RUNTIME_VERSION=\$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
47-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/\${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
48-
&& chmod +x aws-custom-runtime \
49-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/\${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-\${RUNTIME_VERSION}/node-4.x \
50-
&& mv knative-lambda-runtime-\${RUNTIME_VERSION}/node-4.x/* .
51-
52-
ENV LAMBDA_TASK_ROOT "/opt"
41+
FROM gcr.io/triggermesh/knative-lambda-node4
5342
ENV _HANDLER "${HANDLER}"
5443
5544
COPY . .

python-2.7/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM python:2.7-alpine
2+
WORKDIR /opt
3+
4+
RUN apk --no-cache add curl \
5+
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6+
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
8+
&& chmod +x aws-custom-runtime \
9+
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/python-2.7 \
10+
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/python-2.7/* .
11+
12+
ENV LAMBDA_TASK_ROOT "/opt"

python-2.7/buildtemplate.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,8 @@ spec:
3838
- |
3939
cd /workspace/${DIRECTORY}
4040
cat <<EOF > Dockerfile
41-
FROM python:2.7-alpine
42-
WORKDIR /opt
41+
FROM gcr.io/triggermesh/knative-lambda-python27
4342
44-
RUN apk --no-cache add curl \
45-
&& API_VERSION=\$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
46-
&& RUNTIME_VERSION=\$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
47-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/\${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
48-
&& chmod +x aws-custom-runtime \
49-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/\${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-\${RUNTIME_VERSION}/python-2.7 \
50-
&& mv knative-lambda-runtime-\${RUNTIME_VERSION}/python-2.7/* .
51-
52-
ENV LAMBDA_TASK_ROOT "/opt"
5343
ENV _HANDLER "${HANDLER}"
5444
5545
COPY . .

python-3.7/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:alpine3.7
2+
WORKDIR /opt
3+
4+
RUN apk --no-cache add curl \
5+
&& API_VERSION=$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
6+
&& RUNTIME_VERSION=$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print $NF}' | tr -d "\r") \
7+
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
8+
&& chmod +x aws-custom-runtime \
9+
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-${RUNTIME_VERSION}/python-3.7 \
10+
&& mv knative-lambda-runtime-${RUNTIME_VERSION}/python-3.7/* .
11+
12+
ENV LAMBDA_TASK_ROOT "/opt"
13+

python-3.7/buildtemplate.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,8 @@ spec:
3838
- |
3939
cd /workspace/${DIRECTORY}
4040
cat <<EOF > Dockerfile
41-
FROM python:alpine3.7
42-
WORKDIR /opt
41+
FROM gcr.io/triggermesh/knative-lambda-python37
4342
44-
RUN apk --no-cache add curl \
45-
&& API_VERSION=\$(curl -sI https://github.com/triggermesh/aws-custom-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
46-
&& RUNTIME_VERSION=\$(curl -sI https://github.com/triggermesh/knative-lambda-runtime/releases/latest | grep "Location:" | awk -F "/" '{print \$NF}' | tr -d "\r") \
47-
&& curl -sL https://github.com/triggermesh/aws-custom-runtime/releases/download/\${API_VERSION}/aws-custom-runtime > aws-custom-runtime \
48-
&& chmod +x aws-custom-runtime \
49-
&& curl -sL https://github.com/triggermesh/knative-lambda-runtime/archive/\${RUNTIME_VERSION}.tar.gz | tar -xz knative-lambda-runtime-\${RUNTIME_VERSION}/python-3.7 \
50-
&& mv knative-lambda-runtime-\${RUNTIME_VERSION}/python-3.7/* .
51-
52-
ENV LAMBDA_TASK_ROOT "/opt"
5343
ENV _HANDLER "${HANDLER}"
5444
5545
COPY . .

0 commit comments

Comments
 (0)