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

Commit f1d5da7

Browse files
authored
Merge pull request #68 from triggermesh/go-mod
Dep replaced with Go modules
2 parents f540a55 + ea3013a commit f1d5da7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

go/runtime.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,27 @@ spec:
4646
ENV GIT_SSH_COMMAND "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
4747
RUN apk --no-cache add git ca-certificates openssh \
4848
&& go get github.com/triggermesh/aws-custom-runtime \
49-
&& go get github.com/triggermesh/knative-lambda-runtime/go \
50-
&& go get github.com/golang/dep/...
49+
&& go get github.com/triggermesh/knative-lambda-runtime/go
5150
RUN mv /go/bin/go /go/bin/bootstrap
5251
WORKDIR /go/src/handler
5352
COPY . .
5453
RUN if [ -f "$HOME/.ssh/id_$(inputs.params.SSH_KEY)" ]; then \
5554
eval "\$(ssh-agent -s)"; \
5655
ssh-add $HOME/.ssh/id_$(inputs.params.SSH_KEY); \
5756
fi \
58-
&& if [ -f "Gopkg.toml" ]; then dep ensure; fi \
59-
&& go get -v \
60-
&& go install
57+
&& if [ ! -f "go.mod" ]; then \
58+
go mod init handler; \
59+
fi \
60+
&& go get -d -v \
61+
&& go build -o handler
6162
6263
FROM alpine
6364
WORKDIR /opt
6465
ENV LAMBDA_TASK_ROOT "/opt"
6566
ENV _HANDLER "handler"
6667
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
6768
COPY --from=0 /go/bin/ /opt
69+
COPY --from=0 /go/src/handler/handler /opt
6870
ENTRYPOINT ["/opt/aws-custom-runtime"]
6971
EOF
7072
- name: export

0 commit comments

Comments
 (0)