Skip to content

Adding a Project#

Add the project to Lagoon#

  1. Run this command:
Add project
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.

  • 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.

  1. Run the following command to get the deploy key:

    Get project-key
    lagoon get project-key --project <YOUR-PROJECT-NAME>
    
  2. Copy the key and save it as a deploy key in your Git repository.

GitHub GitLab Bitbucket

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

  1. Add your Lagoon cluster's webhook endpoint to your Git repository

  2. Payload URL: <LAGOON-WEBHOOK-INGRESS>

  3. Content Type: JSON
  4. Active: Active (allows you to enable/disable as required)
  5. Events: Select the relevant events, or choose All. Usually push, branch create/delete are required

GitHub GitLab Bitbucket