Table of Contents

Going from code to product in GitHub

In this tutorial, you will learn how to develop, (pre-)release, and optionally deploy any supported DataMiner artifact with a CI/CD pipeline in GitHub. These processes follow the same quality standards that developers within Skyline Communications adhere to.

If you are interested in learning how to set up CI/CD using different technologies, such as Jenkins, GitLab, Concourse, Azure DevOps, etc., take a look at the Setting up basic CI/CD for connectors tutorial.

This CI/CD pipeline will ensure strict quality standards, provide you with a private item registered in the DataMiner Catalog, and give you the ability to deploy the item automatically.

Expected duration: 10 minutes.

Private versus public code

Both SonarCloud and GitHub require paid licenses to fully support private GitHub repositories. For this tutorial, we recommend creating a public repository.

For real-world scenarios, you will likely need at least a paid SonarCloud license to work with private GitHub repositories. A free GitHub version can still be used for private repositories, but it will slightly change the tutorial below.

Prerequisites

Overview

Step 1: Create a Visual Studio project

  1. Open Visual Studio, and select Create a new project.

  2. Select one of the available DataMiner templates from the list of templates (for example Ad Hoc Data Source Solution), and click Next.

  3. Enter a solution name, for example SLC-GQIDS-MyDataSourceTest, and click Next.

    We recommend adhering to Skyline's naming conventions, though this is not mandatory.

  4. Follow the wizard for any additional information requirements.

  5. Click Create.

Step 2: Create a GitHub repository

  1. In the menu bar of Visual Studio, select GIT > Create GIT Repository.

  2. Create a new GitHub repository:

    1. Select a name, specify your GitHub account, and mark yourself as the owner.

    2. When you have entered all the information, click Create and Push.

  3. Go to the newly created GitHub repository on https://github.com/.

    Tip

    In Visual Studio 2022, you can open the GIT menu and select GitHub/View Pull Requests to quickly access the correct repository.

  4. If your repository does not follow Skyline's naming conventions, specify the artifact type:

    1. Go to the Code tab.

    2. Click the cogwheel next to About.

    3. Under Topics, add a topic with the artifact type, as defined under Inferring Catalog Item Type.

Tip

For more information, refer to the GitHubToCatalogYaml readme.

Step 3: Add the Starter Workflow

  1. Go to the Starter Workflow:

    • For public repositories or paid GitHub subscriptions:

      On your GitHub page, go to the Actions tab and select the DataMiner workflow that matches your solution type. If none of the names match, select DataMiner CICD AutomationScript.

    • For private repositories on a free GitHub subscription:

      1. On your GitHub page, go to the Actions tab and select Set up workflow yourself.

      2. Go to Skyline-Starter-Workflows and select the DataMiner workflow that matches your solution type.

        If none of the names match, select DataMiner CICD AutomationScript.

      3. Copy the content of the workflow file and paste it into your new workflow file.

  2. Open a new browser window or tab, go to https://sonarcloud.io/projects/create, and create a project for the correct organization.

  3. Enter the ID of the project as shown in the SonarCloud project URL as the sonarCloudProjectName.

  4. Open a new browser window or tab, and create and add the necessary GitHub secrets that you see in the workflow..

  5. Go back to your pipeline file and click Commit Changes.

    Commit the changes directly to the master branch.

  6. Go to the Actions tab.

    You should see your new workflow running. It will run for every Git push.

You should now see your CI jobs complete successfully, ensuring that quality standards are met.

Step 4: Release a private item in the DataMiner Catalog

  1. On the Code tab for your repository on GitHub, on the right, click Create a new release.

  2. Click Choose a tag and enter the version, for example 1.0.0.1-beta1.

    You can use any version you want. For a pre-release, usually a suffix is added, which can contain any text, e.g. "-beta1" in the example above.

  3. Enter a description of your release.

  4. If this is a pre-release, select Set as a pre-release.

  5. Click Publish release.

  6. Go to the Actions tab.

    You should now see your new workflow running in this tab. Your CI and CD jobs should complete successfully, ensuring quality standards are met and uploading the item to the Catalog UI as a private item.

    Note

    To be granted DevOps Points, take a screenshot of the successful run and send it to thunder@skyline.be.

  7. Go to https://catalog.dataminer.services/, make sure your organization is selected in the top-right corner, and look up your artifact.

Note

If you see the following errors: Push .githubtocatalog/auto-generated-catalog Process completed with exit code 128. or remote: Permission to MyOrg/MyRepo.git denied to github-actionsbot, you will need to either set write permissions for the GITHUB_TOKEN in your specific repository, or, if you are an organization admin, you can enable this for the organization by setting the workflow permissions to Read and write permissions.