Build & Deploy a standard application

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

  • Create a workflow using two pipelines: one for building, another for deploying
  • Discover application and environments concepts.
  • Discover Run Conditions.

This tutorial seems very long, don’t worry, it’s very detailed and it will take you about 10-15 minutes to try it.

You will play with many CDS Concepts, discover the reuse of pipelines, how to play with CDS Variables.

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 - Add a variable on your application

You’ve got an application, let’s create an application variable. We will use it further in a Job.

view screenshots...

5 - Create the workflow

Here we go, you will create your first workflow.

view screenshots...

6 - Edit your first pipeline for building the application

The workflow is initialized with an empty pipeline named ‘build-pipeline’. You have now to create your first job.

view screenshots...

7 - Add a Hook on your workflow

In this example, we create a Workflow to build & deploy an application. This is a standard Continuous Integration & Continuous Delivery Workflow.

So, we have to trigger this workflow on each commit, on every git branches. This will be useful to compile code from all developers and deploy master branch if the build is Ok.

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

8 - Run your workflow

It’s time to launch your Workflow, click on the green button ‘Run workflow’.

view screenshots...

9 - Add a pipeline for deploying your application on staging

Ok, we have an artifact to deploy. Let’s create a deploy pipeline and trigger it after the build pipeline.

view screenshots...

10 - Add a pipeline for deploying your application on production

Same as previous, we will add a pipeline to deploy in production.

view screenshots...

11 - Add run conditions before deploying

So, now, you have a workflow to build your application and deploy it on your staging environment. But, we don’t want to deploy all builds, from all branches, we want to deploy only the master branch. Let’s create a Run Condition on git.branch, to trigger automatically a deployment on staging if git branch is equals to master.

view screenshots...

12 - Add run conditions before deploying in production

Same as ‘deploy-pipeline’ on staging, we will add condition on the pipeline which deploy in ‘production’.

view screenshots...

13 - Edit the name of the pipelines in your workflow

In your project, you’ve got two pipelines: ‘build-pipeline’ and ‘deploy-pipeline’. The ‘deploy-pipeline’ is used twice: once for ‘staging’ deploy, another for ‘production’.

Let’s rename the pipelines on your workflow.

view screenshots...

14 - Edit the ‘deploy-pipeline’

The ‘deploy-pipeline’ is empty for now. Let’s add some stuff to simulate a deployment. We will use CDS Variable from application.

view screenshots...

15 - Run your workflow

Let’s Run the workflow.

view screenshots...

16 - Run the deploy in production

As you add a run condition on the ‘manual-deploy-pipeline’, with cds.manual = true, you have to click on Run to launch a deployment in production.

view screenshots...