Touchless Deployment – Working Session
Dear All,
Previous Article : Introducing Touchless Deployment
In this article, describes step by step how to migrate your sql through Touchless Deployment API and understand each scenario’s for deploying which would benefit customers, partners, DBA’s & Data Integration consultant.
Available for both SAP HANA and Oracle tenants
Getting Started
Step 1 : Enable Touchless deployment role and assign to the user
The Touchless Deployment permission is added in Security > Roles > Administration.The Commissions user who deploys the database changes must be granted with this permission (through a role).
To configure permissions for Touchless Deployment:
1. In Manage Setup > Security > Roles, select the Role that has the permissions to deploy database changes.
Step 2 : Touchless Deployment API’s to check if you have access to deploy.
Below API will not provide any 200ok response.
Method : GET URL : https://0509.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
Below API will provide 200 ok response if User is authenticated, that confirms user can deploy the next step.
Method : GET URL : https://0509.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/status
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
Step 3 : Create your own folder with required xml and *sql format files.
📦 project-folder ┣
📜 master.xml
┣ 📂CR1
┗📜 CR1.sql ┗📜 CR2.sql ┗📜 CR3.sql ┗📜 CR4.sql
Master.xml would be look like below for deploy. you can change XML file name as you per your need. Mention your folder name which will have all your *.sql files.
CR1.sql would like below sample which can continue multiple statements.
Step 4 : Zip the complete root folder
Zip file should have XML and folder (conatins all your sql files).
Step 5 : Lets upload the zipfile for deploying to the database using Touchless Deployment API
Method : POST URL : https://XXXX.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/update?changeMasterFile=master.xml
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
changeLogZip : <your folder path of zip file> (forma-data)
Open the postman or any other API Management tool
2 tables are created after API went successful (202 Accepted) as per above CR1.sql (above screenshot)
Once API is successful, records will be stored in table : ext.cs_td_ext_databasechangelog
If user is tried many times, it will be locked in below table : ext.cs_td_ext_databasechangeloglock
Step 6 : Below API will update the TAG which would be required for rollback statement ..
many of you might know what is database rollback… sometimes rollback are important in your implementation in the long run because if you need to archive the records and delete the entire process, it would help only if you have updated the TAG name for your deployed.
Method : POST URL : https://XXXX.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/tag?tag=version1&changeMasterFile=master.xml
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
changeLogZip : <your folder path of zip file> (select form-data)
Go back to your postman to execute the below API to update the tag which will deploy and reflect immediately in database.
As shown in below screenshot, last row is updated with TAG column Version1
Best Practice :
Always follow Step 6 if you need to rollback in future anytime. Step 5 is straightforward will not rollback.
Step 7 : API to check your Deployed Status
Method : GET
URL : https://XXXX.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/getstatus/22
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
Step 8 : Roll back Scenario on last ChangeSet
Below API will rollback the last number of changesets (the number is provided in your sql file in 2nd line).
Method : POST URL : https://XXXX.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/rollbackLastChangesets?changeMasterFile=master.xml&changesets=9998
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
changeLogZip : <your folder path of zip file> (select form-data)
Back to your postman, execute the below API endpoint to complete your rollback statement.
In my example, changeset = 9998 was executed in Step 6 which was in my sql file statement
After the API is successfull, that confirms your sql is executed successfully and you don’t see the records in log table …
Step 9 : Roll back Scenario on Tag column
Below API will rollback based on RollbackToTag endpoint allows the user to rollback all changes which have been done after the TAG
Method : POST URL : https://XXXX.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/rollbackToTag?changeMasterFile=master.xml&tag=Version1
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
changeLogZip : <your folder path of zip file> (select form-data)
Step 10 : Roll back Scenario on Date column
Below API will rollback based on RollbackToDate endpoint allows the user to rollback all changes which have been done after the date
Method : POST URL : https://XXXX.callidusondemand.com/TrueComp-SaaS/services/rest/touchlessdeployment/rollbackToDate?changeMasterFile=master.xml&date=2022-06-21,12:27:13
Authentication : Basic XXXXXXXXXXXXXX
content-type : application/json
changeLogZip : <your folder path of zip file> (select form-data)
Note:
Refer Housekeeping Notes from Previous Article : Introducing Touchless Deployment
Understand Liquibase Documentation
https://docs.liquibase.com/concepts/changelogs/sql-format.html
https://docs.liquibase.com/workflows/liquibase-community/liquibase-auto-rollback.html
Coming Next Blog : Deploy your Database objects through CI/CD concept