Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,64 @@ lifecycle is a tool that transforms pull requests into ephemeral development env
Isolated sandboxes for partners and vendors that share only what’s necessary, avoiding full staging access.

Happy coding! Join the community on [Discord](https://discord.gg/TEtKgCs8T8)


## Development

### Prerequisites

Install the following tools using [Homebrew](https://brew.sh/):

```shell
brew install tilt kind kubectx kubectl
brew install --cask docker
```

### Configuration

- **Ngrok**:
The project uses `ngrok` to create a public URL for your local instance. You will need to:
- Sign up for an [ngrok account](https://dashboard.ngrok.com/signup) to get an authtoken.
- Set the following environment variables. You can add them to your shell profile (e.g., `~/.zshrc` or `~/.bash_profile`).

```shell
export NGROK_AUTHTOKEN="<your_ngrok_authtoken>"
export NGROK_LIFECYCLE_DOMAIN="<your_ngrok_domain>" # your ngrok domain. needs paid plan to get a static domain
```

- **AWS Credentials**: (Optional, if using AWS ECR)
Ensure your AWS credentials are set up in `~/.aws/credentials`. The Tilt environment needs this to create a Kubernetes secret for the application.

### Running Locally

- Create a local Kubernetes cluster using `kind`:
```shell
kind create cluster --config sysops/tilt/kind-config.yaml --name lfc
```
> [!IMPORTANT]
> We need to use a custom `kind` config file to allow insecure registries setup for local development.

- Switch your Kubernetes context to the newly created cluster:
```shell
kx kind-lfc
```

- Setup local env secrets at `helm/environments/local/secrets.yaml`:
```yaml
secrets:
databaseUrl: postgresql://lifecycle:lifecycle@local-postgres:5432/lifecycle
redisUrl: redis://redis-master:6379
githubPrivateKey: "<private_key_without_new_lines>"
githubClientSecret: "<client_secret>"
githubWebhookSecret: "<webhook_secret>"
githubAppId: "<app_id>"
githubClientId: "<client_id>"
githubInstallationId: "<installation_id>"
```
> [!NOTE]
> You can create the GitHub app with the app creation setup flow and then copy the secrets created for local development.

- Start the development environment using `tilt`:
```shell
tilt up
```
11 changes: 0 additions & 11 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,6 @@ k8s_resource(
labels=["infra"]
)

# Helper function to add namespace to kubernetes resources
def kustomize_with_helm(yaml_path, namespace):
yaml = helm(
None,
name="custom-namespace",
namespace=namespace,
template=[yaml_path],
set=["namespace={}".format(namespace)]
)
return yaml

##################################
# DISTRIBUTION
##################################
Expand Down
Loading