Skip to content

Commit 2e3e541

Browse files
authored
Merge pull request #7 from GoodRxOSS/setup-doc-update
add steps for configuring BUILDKIT_HOST
2 parents 46c3d53 + 146b7c0 commit 2e3e541

File tree

3 files changed

+80
-2
lines changed

3 files changed

+80
-2
lines changed

src/lib/static/blogcontent/blogcontent.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"description": null,
8282
"date": null,
8383
"path": "docs/setup/create-github-app",
84-
"body": "To create a Github app that will send events to the Lifecycle with necessary permissions, follow these steps:\n\n\n Make sure you have admin access to the Github organization or account where\n you want to create the app.\n\n\n- Navigate to your installed Lifecycle app at `https://app./setup` (replace `` with your actual domain. e.g. `https://app.0env.com/setup`).\n \n- Select `Personal` or `Organization` based on your needs.\n- Fill in the required fields:\n\n - **Github App Name**: A name for your app. (should be unique, use a prefix with your name or organization. Refer Github app naming convention [here](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/)\n - **Organization Name**: Github organization name where the app will be created. Required if you selected `Organization`.\n\n- Click `Create App`\n- On the Github app creation page, confirm the app name and click `Create`\n- Once the app is created, you will be redirected to the app installation page where you can choose one or more repositories to install the the newly minted app.\n\n \n Make sure to select the repositories you want the app to have access to. You\n can always change this later in the app settings but **adding atleast one\n repository is required to proceed with the setup**.\n \n\n \n\n- Voila! 🎉 Your Github app is now created and installed.\n\n\n\n- Click `Configure and Restart` to apply the changes and start using the app.\n\n\n The step above, sets up the global config values that Lifecycle app will use\n creating ephemeral environments and processing pull requests. And restarts the\n `deployment` for the github app secrets to take effect.\n\n\n---\n\nLet's move on the final step where we will configure the Lifecycle app config for processing pull requests and creating ephemeral environments."
84+
"body": "## Configure BuildKit Endpoint\n\nBefore creating the GitHub app, you need to configure the BuildKit endpoint in the database:\n\n\n Set the `HELM_RELEASE` environment variable to your actual Helm release name\n before running the commands below.\n\n\n\n The following commands will create the `buildkit` object and `endpoint`\n configuration if they don't exist, or update them if they do.\n\n\n### Option 1: Using kubectl exec with psql\n\nExecute the following commands to connect to the PostgreSQL pod and run the query:\n\n```bash\n# Set your Helm release name (replace with your actual release name)\nexport HELM_RELEASE=\n\n# Get the database password from the secret\nexport PGPASSWORD=$(kubectl get secret ${HELM_RELEASE}-postgres -n lifecycle-app -o jsonpath='{.data.POSTGRES_USER_PASSWORD}' | base64 -d)\n\n# Run the query\nkubectl exec -it ${HELM_RELEASE}-postgres-0 -n lifecycle-app -- env PGPASSWORD=$PGPASSWORD psql -U lifecycle -d lifecycle -c \"\nUPDATE global_config\nSET config = jsonb_set(\n jsonb_set(\n COALESCE(config::jsonb, '{}'::jsonb),\n '{buildkit}',\n COALESCE(config::jsonb->'buildkit', '{}'::jsonb),\n true\n ),\n '{buildkit,endpoint}',\n '\\\"tcp://${HELM_RELEASE}-buildkit.lifecycle-app.svc.cluster.local:1234\\\"'::jsonb,\n true\n),\n\\\"updatedAt\\\" = NOW()\nWHERE key = 'buildDefaults';\"\n```\n\n### Option 2: Direct SQL query\n\nIf you have direct database access, run the following SQL query (replace `` with your actual Helm release name):\n\n```sql\nUPDATE global_config\nSET config = jsonb_set(\n jsonb_set(\n COALESCE(config::jsonb, '{}'::jsonb),\n '{buildkit}',\n COALESCE(config::jsonb->'buildkit', '{}'::jsonb),\n true\n ),\n '{buildkit,endpoint}',\n '\"tcp://-buildkit.lifecycle-app.svc.cluster.local:1234\"'::jsonb,\n true\n),\n\"updatedAt\" = NOW()\nWHERE key = 'buildDefaults';\n```\n\n### Refresh Configuration Cache\n\nAfter running either option above, refresh the configuration cache:\n\n```bash\ncurl -X 'PUT' \\\n 'https://app./api/v1/config/cache' \\\n -H 'accept: application/json'\n```\n\nReplace `` with your actual domain (e.g., `0env.com`).\n\n## Create GitHub App\n\nTo create a Github app that will send events to the Lifecycle with necessary permissions, follow these steps:\n\n\n Make sure you have admin access to the Github organization or account where\n you want to create the app.\n\n\n- Navigate to your installed Lifecycle app at `https://app./setup` (replace `` with your actual domain. e.g. `https://app.0env.com/setup`).\n \n- Select `Personal` or `Organization` based on your needs.\n- Fill in the required fields:\n\n - **Github App Name**: A name for your app. (should be unique, use a prefix with your name or organization. Refer Github app naming convention [here](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/)\n - **Organization Name**: Github organization name where the app will be created. Required if you selected `Organization`.\n\n- Click `Create App`\n- On the Github app creation page, confirm the app name and click `Create`\n- Once the app is created, you will be redirected to the app installation page where you can choose one or more repositories to install the the newly minted app.\n\n \n Make sure to select the repositories you want the app to have access to. You\n can always change this later in the app settings but **adding atleast one\n repository is required to proceed with the setup**.\n \n\n \n\n- Voila! 🎉 Your Github app is now created and installed.\n\n\n\n- Click `Configure and Restart` to apply the changes and start using the app.\n\n\n The step above, sets up the global config values that Lifecycle app will use\n creating ephemeral environments and processing pull requests. And restarts the\n `deployment` for the github app secrets to take effect.\n\n\n---\n\nLet's move on the final step where we will configure the Lifecycle app config for processing pull requests and creating ephemeral environments."
8585
},
8686
{
8787
"title": "Deploy Issues",

src/lib/static/blogcontent/blogcontent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const blogContent = [
8585
description: null,
8686
date: null,
8787
path: "docs/setup/create-github-app",
88-
body: "To create a Github app that will send events to the Lifecycle with necessary permissions, follow these steps:\n\n\n Make sure you have admin access to the Github organization or account where\n you want to create the app.\n\n\n- Navigate to your installed Lifecycle app at `https://app./setup` (replace `` with your actual domain. e.g. `https://app.0env.com/setup`).\n \n- Select `Personal` or `Organization` based on your needs.\n- Fill in the required fields:\n\n - **Github App Name**: A name for your app. (should be unique, use a prefix with your name or organization. Refer Github app naming convention [here](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/)\n - **Organization Name**: Github organization name where the app will be created. Required if you selected `Organization`.\n\n- Click `Create App`\n- On the Github app creation page, confirm the app name and click `Create`\n- Once the app is created, you will be redirected to the app installation page where you can choose one or more repositories to install the the newly minted app.\n\n \n Make sure to select the repositories you want the app to have access to. You\n can always change this later in the app settings but **adding atleast one\n repository is required to proceed with the setup**.\n \n\n \n\n- Voila! 🎉 Your Github app is now created and installed.\n\n\n\n- Click `Configure and Restart` to apply the changes and start using the app.\n\n\n The step above, sets up the global config values that Lifecycle app will use\n creating ephemeral environments and processing pull requests. And restarts the\n `deployment` for the github app secrets to take effect.\n\n\n---\n\nLet's move on the final step where we will configure the Lifecycle app config for processing pull requests and creating ephemeral environments.",
88+
body: "## Configure BuildKit Endpoint\n\nBefore creating the GitHub app, you need to configure the BuildKit endpoint in the database:\n\n\n Set the `HELM_RELEASE` environment variable to your actual Helm release name\n before running the commands below.\n\n\n\n The following commands will create the `buildkit` object and `endpoint`\n configuration if they don't exist, or update them if they do.\n\n\n### Option 1: Using kubectl exec with psql\n\nExecute the following commands to connect to the PostgreSQL pod and run the query:\n\n```bash\n# Set your Helm release name (replace with your actual release name)\nexport HELM_RELEASE=\n\n# Get the database password from the secret\nexport PGPASSWORD=$(kubectl get secret ${HELM_RELEASE}-postgres -n lifecycle-app -o jsonpath='{.data.POSTGRES_USER_PASSWORD}' | base64 -d)\n\n# Run the query\nkubectl exec -it ${HELM_RELEASE}-postgres-0 -n lifecycle-app -- env PGPASSWORD=$PGPASSWORD psql -U lifecycle -d lifecycle -c \"\nUPDATE global_config\nSET config = jsonb_set(\n jsonb_set(\n COALESCE(config::jsonb, '{}'::jsonb),\n '{buildkit}',\n COALESCE(config::jsonb->'buildkit', '{}'::jsonb),\n true\n ),\n '{buildkit,endpoint}',\n '\\\"tcp://${HELM_RELEASE}-buildkit.lifecycle-app.svc.cluster.local:1234\\\"'::jsonb,\n true\n),\n\\\"updatedAt\\\" = NOW()\nWHERE key = 'buildDefaults';\"\n```\n\n### Option 2: Direct SQL query\n\nIf you have direct database access, run the following SQL query (replace `` with your actual Helm release name):\n\n```sql\nUPDATE global_config\nSET config = jsonb_set(\n jsonb_set(\n COALESCE(config::jsonb, '{}'::jsonb),\n '{buildkit}',\n COALESCE(config::jsonb->'buildkit', '{}'::jsonb),\n true\n ),\n '{buildkit,endpoint}',\n '\"tcp://-buildkit.lifecycle-app.svc.cluster.local:1234\"'::jsonb,\n true\n),\n\"updatedAt\" = NOW()\nWHERE key = 'buildDefaults';\n```\n\n### Refresh Configuration Cache\n\nAfter running either option above, refresh the configuration cache:\n\n```bash\ncurl -X 'PUT' \\\n 'https://app./api/v1/config/cache' \\\n -H 'accept: application/json'\n```\n\nReplace `` with your actual domain (e.g., `0env.com`).\n\n## Create GitHub App\n\nTo create a Github app that will send events to the Lifecycle with necessary permissions, follow these steps:\n\n\n Make sure you have admin access to the Github organization or account where\n you want to create the app.\n\n\n- Navigate to your installed Lifecycle app at `https://app./setup` (replace `` with your actual domain. e.g. `https://app.0env.com/setup`).\n \n- Select `Personal` or `Organization` based on your needs.\n- Fill in the required fields:\n\n - **Github App Name**: A name for your app. (should be unique, use a prefix with your name or organization. Refer Github app naming convention [here](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/)\n - **Organization Name**: Github organization name where the app will be created. Required if you selected `Organization`.\n\n- Click `Create App`\n- On the Github app creation page, confirm the app name and click `Create`\n- Once the app is created, you will be redirected to the app installation page where you can choose one or more repositories to install the the newly minted app.\n\n \n Make sure to select the repositories you want the app to have access to. You\n can always change this later in the app settings but **adding atleast one\n repository is required to proceed with the setup**.\n \n\n \n\n- Voila! 🎉 Your Github app is now created and installed.\n\n\n\n- Click `Configure and Restart` to apply the changes and start using the app.\n\n\n The step above, sets up the global config values that Lifecycle app will use\n creating ephemeral environments and processing pull requests. And restarts the\n `deployment` for the github app secrets to take effect.\n\n\n---\n\nLet's move on the final step where we will configure the Lifecycle app config for processing pull requests and creating ephemeral environments.",
8989
},
9090
{
9191
title: "Deploy Issues",

src/pages/docs/setup/create-github-app.mdx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,84 @@ tags:
1010
import { Callout } from "nextra/components";
1111
import { Image } from "@lifecycle-docs/components";
1212

13+
## Configure BuildKit Endpoint
14+
15+
Before creating the GitHub app, you need to configure the BuildKit endpoint in the database:
16+
17+
<Callout type="warning">
18+
Set the `HELM_RELEASE` environment variable to your actual Helm release name
19+
before running the commands below.
20+
</Callout>
21+
22+
<Callout type="info">
23+
The following commands will create the `buildkit` object and `endpoint`
24+
configuration if they don't exist, or update them if they do.
25+
</Callout>
26+
27+
### Option 1: Using kubectl exec with psql
28+
29+
Execute the following commands to connect to the PostgreSQL pod and run the query:
30+
31+
```bash
32+
# Set your Helm release name (replace with your actual release name)
33+
export HELM_RELEASE=<YOUR-HELM-RELEASE>
34+
35+
# Get the database password from the secret
36+
export PGPASSWORD=$(kubectl get secret ${HELM_RELEASE}-postgres -n lifecycle-app -o jsonpath='{.data.POSTGRES_USER_PASSWORD}' | base64 -d)
37+
38+
# Run the query
39+
kubectl exec -it ${HELM_RELEASE}-postgres-0 -n lifecycle-app -- env PGPASSWORD=$PGPASSWORD psql -U lifecycle -d lifecycle -c "
40+
UPDATE global_config
41+
SET config = jsonb_set(
42+
jsonb_set(
43+
COALESCE(config::jsonb, '{}'::jsonb),
44+
'{buildkit}',
45+
COALESCE(config::jsonb->'buildkit', '{}'::jsonb),
46+
true
47+
),
48+
'{buildkit,endpoint}',
49+
'\"tcp://${HELM_RELEASE}-buildkit.lifecycle-app.svc.cluster.local:1234\"'::jsonb,
50+
true
51+
),
52+
\"updatedAt\" = NOW()
53+
WHERE key = 'buildDefaults';"
54+
```
55+
56+
### Option 2: Direct SQL query
57+
58+
If you have direct database access, run the following SQL query (replace `<YOUR-HELM-RELEASE>` with your actual Helm release name):
59+
60+
```sql
61+
UPDATE global_config
62+
SET config = jsonb_set(
63+
jsonb_set(
64+
COALESCE(config::jsonb, '{}'::jsonb),
65+
'{buildkit}',
66+
COALESCE(config::jsonb->'buildkit', '{}'::jsonb),
67+
true
68+
),
69+
'{buildkit,endpoint}',
70+
'"tcp://<YOUR-HELM-RELEASE>-buildkit.lifecycle-app.svc.cluster.local:1234"'::jsonb,
71+
true
72+
),
73+
"updatedAt" = NOW()
74+
WHERE key = 'buildDefaults';
75+
```
76+
77+
### Refresh Configuration Cache
78+
79+
After running either option above, refresh the configuration cache:
80+
81+
```bash
82+
curl -X 'PUT' \
83+
'https://app.<your_domain>/api/v1/config/cache' \
84+
-H 'accept: application/json'
85+
```
86+
87+
Replace `<your_domain>` with your actual domain (e.g., `0env.com`).
88+
89+
## Create GitHub App
90+
1391
To create a Github app that will send events to the Lifecycle with necessary permissions, follow these steps:
1492

1593
<Callout type="info">

0 commit comments

Comments
 (0)