From d8c06be498acbfc2024c01b6b6b02d120dc499f2 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 14 Nov 2019 12:06:30 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/user/project/clusters/serverless/index.md | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'doc/user/project') diff --git a/doc/user/project/clusters/serverless/index.md b/doc/user/project/clusters/serverless/index.md index be6371bb1ca..26db2133d09 100644 --- a/doc/user/project/clusters/serverless/index.md +++ b/doc/user/project/clusters/serverless/index.md @@ -313,6 +313,41 @@ The sample function can now be triggered from any HTTP client using a simple `PO ![function execution](img/function-execution.png) +### Running functions locally + +Running a function locally is a good way to quickly verify behavior during development. + +Running functions locally requires: + +- Go 1.12 or newer installed. +- Docker Engine installed and running. +- `gitlabktl` installed using the Go package manager: + + ```shell + GO111MODULE=on go get gitlab.com/gitlab-org/gitlabktl + ``` + +To run a function locally: + +1. Navigate to the root of your GitLab serverless project. +1. Build your function into a Docker image: + + ```shell + gitlabktl serverless build + ``` + +1. Run your function in Docker: + + ```shell + docker run -itp 8080:8080 + ``` + +1. Invoke your function: + + ```shell + curl http://localhost:8080 + ``` + ## Deploying Serverless applications > Introduced in GitLab 11.5. -- cgit v1.2.1