You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
8. Create a webhook in your GitLab project. Set the URL to `http[s]://<PR_AGENT_HOSTNAME>/webhook`, the secret token to the generated secret from step 3, and enable the triggers `push`, `comments` and `merge request events`.
89
89
90
90
9. Test your installation by opening a merge request or commenting on a merge request using one of PR Agent's commands.
91
+
92
+
## Deploy as a Lambda Function
93
+
94
+
Note that since AWS Lambda env vars cannot have "." in the name, you can replace each "." in an env variable with "__".<br>
95
+
For example: `GITLAB.PERSONAL_ACCESS_TOKEN`--> `GITLAB__PERSONAL_ACCESS_TOKEN`
96
+
97
+
1. Follow steps 1-5 from [Run a GitLab webhook server](#run-a-gitlab-webhook-server).
98
+
2. Build a docker image that can be used as a lambda function
4. Create a lambda function that uses the uploaded image. Set the lambda timeout to be at least 3m.
112
+
5. Configure the lambda function to have a Function URL.
113
+
6. In the environment variables of the Lambda function, specify `AZURE_DEVOPS_CACHE_DIR` to a writable location such as /tmp. (see [link](https://github.com/Codium-ai/pr-agent/pull/450#issuecomment-1840242269))
114
+
7. Go back to steps 8-9 of [Run a GitLab webhook server](#run-a-gitlab-webhook-server) with the function url as your Webhook URL.
115
+
The Webhook URL would look like `https://<LAMBDA_FUNCTION_URL>/webhook`
116
+
117
+
### Using AWS Secrets Manager
118
+
119
+
For production Lambda deployments, use AWS Secrets Manager instead of environment variables:
120
+
121
+
1. Create individual secrets for each GitLab webhook with this JSON format (e.g., secret name: `project-webhook-secret-001`)
122
+
123
+
```json
124
+
{
125
+
"gitlab_token": "glpat-xxxxxxxxxxxxxxxxxxxxxxxx",
126
+
"token_name": "project-webhook-001"
127
+
}
128
+
```
129
+
130
+
2. Create a main configuration secret for common settings (e.g., secret name: `pr-agent-main-config`)
0 commit comments