summaryrefslogtreecommitdiff
path: root/doc/user/project
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-14 12:06:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-14 12:06:30 +0000
commitd8c06be498acbfc2024c01b6b6b02d120dc499f2 (patch)
tree9e2e0852c45332d6222898676a2f6f096e600084 /doc/user/project
parent2fa7d2ddf6a7004f89616e43b8279229af831e25 (diff)
downloadgitlab-ce-d8c06be498acbfc2024c01b6b6b02d120dc499f2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/user/project')
-rw-r--r--doc/user/project/clusters/serverless/index.md35
1 files changed, 35 insertions, 0 deletions
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 <your_function_name>
+ ```
+
+1. Invoke your function:
+
+ ```shell
+ curl http://localhost:8080
+ ```
+
## Deploying Serverless applications
> Introduced in GitLab 11.5.