Build, tag and release an application

In this tutorial, you will create a CDS Workflow with the Web UI.

  • Create a workflow using two pipelines: one for building, a second for tagging
  • You will discover the GitTag action, which create tag compatible which Semantic Verstionning 2.0.0

1 - Create your CDS project

Let’s create a project. On the top navbar, click on ‘Create a project’.

view screenshots...

2 - Add a repository manager on your project

The project is now create, you have to link a repository manager. Be sure to have a Repository manager as GitHub, Bitbucket Server or GitLab setted up on your CDS Instance.

view screenshots...

You’ve got a project, linked to GitHub. Let’s create an application.

A CDS Application is useful to have a link to a Git Repository.

view screenshots...

4 - Generate a GitHub Token

This token will be used to let CDS create a tag.

view screenshots...

5 - Create the workflow

Notice: the build pipeline does nothing here. You can add some job inside it, please read this tutorial to create a ‘build’ pipeline.

view screenshots...

6 - Add a Hook on your workflow

In this example, we create a Workflow to build, tag and release an application.

So, we have to trigger this workflow on each commit, on every git branches - and on each tag created. This will be useful to compile code from all developer and sometimes create a tag from master branch if the build is Success.

The application is linked to a GitHub Git Repository, we have two choices to trigger automatically the workflow:

The difference between both is simple: a Git Repository Webhook does not work if your CDS Instance is not reachable from GitHub. So, we have to add a Git Repository Poller

view screenshots...

7 - Create a tag

version: v1.0
name: create-tag
parameters:
  tagLevel:
    type: list
    default: major;minor;patch
    description: major, minor or patch
jobs:
- job: CreateTag
  steps:
  - checkout: '{{.cds.workspace}}'
  - gitTag:
      path: '{{.cds.workspace}}'
      tagLevel: '{{.cds.pip.tagLevel}}'
      tagMessage: Release from CDS run {{.cds.version}}
view screenshots...

8 - Run Workflow

The workflow is now ready to be launched, but before launch it, let’s configure some Run Condition on the pipeline ‘create-tag’. We don’t want to launch it on each commit - we want to decide when to launch it.

view screenshots...

9 - Release Action

Release action action is implemented for GitHub only. You can use it to create a release from a tag and push some artifacts on it.

view screenshots...