This documentation is for an older Keptn release. Please consider the newest one when working with the latest Keptn.

Project

Learn how to manage your projects in Keptn.

Select Git-based upstream

Keptn will manage a project in an internal Git repository. To upstream this repository to a remote place that also works as backup, it is recommended to create, for example, a GitHub repository. This GitHub repository is then specified as upstream repo when creating a project explained below.

Select one of the four options and make sure to have the Git user, token, and remote url before continuing.

GitHub

⚠️ Since new GitHub repositories are created with the default branch main instead of master, please manually create a master branch in your GitHub repo.

Create user, token, and repository

  1. If you do not have a GitHub user, create a user by signing up.

  2. Create a personal access token for your user with repo scope:

    GitHub access token
  3. (optional) If you want to use a dedicated GitHub organization for your repository, create a GitHub organization.

  4. Go to your account or your GitHub organization and create a GitHub repository.

    Note: Click the Initialize this repository with a README checkbox to initialize the repository, which is a prerequisite.

    GitHub create repository

GitLab

Create user, token, and project

  1. If you do not have a GitLab user, create a user by signing up for a free trial.

  2. Create a personal access token for your user with write_repo scope:

    GitHub access token
  3. Go to your account and create a GitLab project.

    Note: Click the Initialize this repository with a README checkbox to initialize the repository, which is a prerequisite.

    GitLab create project

Bitbucket

Create user, token, and repository

  1. If you do not have a Bitbucket user, create a user by signing up for a free trial.

  2. Create an app password for your user with Write permissions. Therefore, select your User > View profile > Settings > App passwords > Create app password

    Bitbucket access token
  3. Go to your account and create a Bitbucket repository.

    Note: Select Include a README? - Yes, with a template to initialize the repository, which is a prerequisite.

    Bitbucket create repository

Azure DevOps Repo

Create user, token, and repository

  1. If you do not have an Azure DevOps user, create a user by signing up for a free trial.

  2. Create a personal access token for your user with Read & write access for the Code:

    Note: Please carefully select the Expiration date.

    Azure DevOps access token
  3. Go to your account and create an Azure project

    Azure DevOps repository
  4. Retrieve the URL for your repository.

    Important: Remove the User from the URL before passing it to Keptn. For example, in the picture below the URL would be https://dev.azure.com/YOUR-ORG/keptn/_git/keptn.

    Azure DevOps clone repository

Create a project

In Keptn, a project is a structure that allows organizing your services. A project is stored as a repository and contains branches representing the multi-stage environment (e.g., dev, staging, and production stage). In other words, the separation of stage configurations is based on repository branches. To describe the stages, a shipyard.yaml file is needed that specifies the name, deployment strategy, test strategy, and remediation strategy as shown by an example below:

stages:
  - name: "dev"
    deployment_strategy: "direct"
    test_strategy: "functional"
  - name: "staging"
    deployment_strategy: "blue_green_service"
    test_strategy: "performance"
  - name: "production"
    deployment_strategy: "blue_green_service"
    remediation_strategy: "automated"

Note: To learn more about a shipyard file, click here Shipyard specification.

  • Recommended approach for Keptn in production: Create a project with the Keptn CLI using a Git upstream:

    keptn create project PROJECTNAME --shipyard=FILEPATH --git-user=GIT_USER --git-token=GIT_TOKEN --git-remote-url=GIT_REMOTE_URL
    
  • Demo/Lab setting: Create a project with the Keptn CLI without a Git upstream and no backup:

    keptn create project PROJECTNAME --shipyard=FILEPATH
    

Delete a project

To delete a Keptn project, the delete project command is provided:

  keptn delete project PROJECTNAME

Note: If a Git upstream is configured for this project, the referenced repository or project will not be deleted. Besides, deployed services are also not deleted by this command. To clean-up all resources created by Keptn, please follow the information displayed here: Helm - Clean-up after deleting a project

Update a project

Updating a project is currently supported by following the steps of deleting a project and creating the project with updated settings.