Adding a Project#
Add the project to Lagoon#
- Run this command:
lagoon add project \ --gitUrl <YOUR-GITHUB-REPO-URL> \ --openshift 1 \ --productionEnvironment <YOUR-PROD-ENV> \ --branches <THE-BRANCHES-YOU-WANT-TO-DEPLOY> \ --project <YOUR-PROJECT-NAME>
- The value for
--openshift
is the ID of your Kubernetes cluster. - Your production environment should be the name of the branch you want to have as your production environment.
- The branches you want to deploy might look like this: “^(main|develop)$”
- The name of your project is anything you want - “Company Website,” “example,” etc.
- The value for
- Go to the Lagoon UI, and you should see your project listed!
Add the deploy key to your git repository#
Lagoon creates a deploy key for each project. You now need to add it as a deploy key in your Git repository to allow Lagoon to download the code.
- Run the following command to get the deploy key:
lagoon get project-key --project <YOUR-PROJECT-NAME>
- Copy the key and save it as a deploy key in your Git repository.
Add the webhooks endpoint to your git repository#
In order for Lagoon to be able to deploy on code updates, it needs to be connected to your git repository
- Add your Lagoon cluster's webhook endpoint to your git repository
- Payload URL:
<LAGOON-WEBHOOK-INGRESS>
- Content Type: JSON
- Active: Active (allows you to enable/disable as required)
- Events: Select the relevant events, or choose All. Usually Push, Branch Create/Delete are required
- Payload URL: