Skip to Content
Technical Articles
Author's profile photo Yogananda Muthaiah

Touchless Deployment 🚀- CI/CD Process using Github Actions

Previous Article : Introducing Touchless Deployment  & Working Session

Dear All,

In this article, describes how you can automate your SQL deployments to SAP Commission database automatically using Touchless Deployment API’s through CI/CD Process from Github Actions.

Every customer adheres to the CI/CD Process to ensure that their deployment code is compatible, uses version control, and maintains an approval process for deployment because technology is developing quickly.

github actions

 

Continuous integration and continuous deployment (CI/CD) is defined as a set of operating principles and capabilities that enables software changes to be delivered to users in a timely, repeatable, and secure manner by introducing automation into software development processes

https://s33168.pcdn.co/wp-content/uploads/2018/11/word-image-128.png

Benefits of continuous integration:

  • Prevent integration errors
  • Committing code frequently
  • Continuous feedback mechanisms
  • Catch bugs early
  • and many more

Tools for continuous integration:

There are many tools for CI. Some of the popular tools are:

  • SAP Continuous Integration and Deployment
  • Jenkins
  • Bitbucket Pipelines
  • AWS CodePipeline
  • CircleCI
  • GitHub Actions

Quickstart using GitHub Actions to deploy your DB Objects

Try out the features of GitHub Actions in 5 minutes or less to deploy your SQL DB Objects automatically using Touchless API’s provided by SAP Commissions

Introduction

You only need a GitHub repository to create and run a GitHub Actions workflow. In this article, you’ll see a workflow that demonstrates some of the essential features of GitHub Actions.

The following example shows you how GitHub Actions jobs can be automatically triggered, where they run, and how they can interact with the code in your repository.

Viewing your workflow results

  • On GitHub.com, navigate to the main page of your repository. (Sample repo of my project)
  • Under your repository name, click    Actions.
  • In the left sidebar, click the workflow you want to see.  As you see in the screenshot, I have 3 ways to execute the workflow – Curl, Nodejs and Python to deploy. so whichever you know the programming language,, you can prefer to write it.NodeJs (Javascript)
    var axios = require('axios');
    var FormData = require('form-data');
    var fs = require('fs');
    var data = new FormData();
    data.append('changeLogZip', fs.createReadStream('liquibase.zip'));
    
    tenant = process.env.TENANT
    username = process.env.USERNAME
    pwd = process.env.PASSWORD
    
    var config = {
      method: 'post',
      url: 'https://tenant.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/update?changeMasterFile=master.xml',
      auth: {
      username: username,
      password: pwd,
      },
      headers: { 
        ...data.getHeaders()
      },
      data : data
    };
    
    axios(config)
    .then(function (response) {
      console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
      console.log(error);
    });​

    Python

    import requests
    import os
    
    tenant = os.environ.get('TENANT')
    token = 'Basic ' + os.environ.get('TOKEN')
    
    url = "https://" +tenant+ ".callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/update?changeMasterFile=master.xml"
    print(url)
    
    payload={}
    files=[
      ('changeLogZip',('liquibase.zip',open('liquibase.zip','rb'),'application/zip'))
    ]
    headers = {
      'Authorization': token
    }
    print(headers)
    response = requests.request("POST", url, headers=headers, data=payload, files=files)
    
    print(response.text)​

  • From the list of workflow runs, click the name of the run you want to see.
  • Under Jobs , click the Explore-GitHub-Actions job.

    Once Jobs is successful, you can see the information in the database with all the details related to sql statement is executed which was in my Folder1 in github repo.
  • The log shows you how each of the steps was processed. Expand any of the steps to view its details.

Add a repository secret

you need to add your SAP Commissions Rest API credentials to secret, so that its secured and nobody can see from your repository code.  Below example is provided.Secrets in GitHub Actions - Octopus Deploy

  1. Open your project’s repository in GitHub and click Settings in the top menu.
  2. Click Secrets in the left menu.
  3. Click New repository secret.
  4. Complete the following fields and click Add secret:
    • Name – give your secret a suitable name. You can’t use spaces or special characters other than underscores.
    • Value – enter the secret, such as your API key.

You can update the value of your secret at any time. Return to Secrets in the repository menu and click Update on the secret you need to change.


References

Git Flow

Learn how to Adopt Version Control for every project

Basics of GIT – [WebIDE Integration with GIT]

Closing Thoughts for Developers motivation

Assigned Tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Teja Thogaru
      Teja Thogaru

      Great Information Harvey 🙂

      Author's profile photo Yogananda Muthaiah
      Yogananda Muthaiah
      Blog Post Author

      Thank you Mike 🙂 As always you're the first person to give feedback :ybow:

      Author's profile photo Deepan Shanmugam Chandrasekar
      Deepan Shanmugam Chandrasekar

      Awesome, thanks for sharing Yoga!

      Author's profile photo Yogananda Muthaiah
      Yogananda Muthaiah
      Blog Post Author

      Thank you Deepan Shanmugam Chandrasekar !! :worlds-best-boss:

      Author's profile photo Siva Selagala
      Siva Selagala

      Thanks for sharing this information Yoga.. It helps a lot to customers to automate their deployment activities..!

      Author's profile photo Yogananda Muthaiah
      Yogananda Muthaiah
      Blog Post Author

      Thank you Siva Selagala !! It really helps customers to automate end to end without any manual and as well without creating a support ticket by providing any sql's ..  Its clean process and much more efficient 🙂

      Since your having too much of experience working with customers, could you please provide the feedback using Touchless Deployment API's.. so we can hear from you if something you find out.

      Author's profile photo Rakesh Rayineni
      Rakesh Rayineni

      Thank you Yoga.This will help our customers a lot.

      Author's profile photo Yogananda Muthaiah
      Yogananda Muthaiah
      Blog Post Author

      Thank you Rakesh Rayineni !! yes, it makes life easy for customers to deploy by their own 🙂

      Author's profile photo Raghuram Valluru
      Raghuram Valluru

      Thanks for sharing this Yoga.. 🙂

      Author's profile photo Yogananda Muthaiah
      Yogananda Muthaiah
      Blog Post Author

      Thank you Sai 🙂 Raghuram Valluru