Request A Demo
Back to All Blog Articles

Setup GIT Integrations in FlexDeploy using REST API

FlexDeploy has various REST API that can be used for many useful purposes. For example, you can create Topology configurations or execute Build and Deploy workflows using REST API. See details at FlexDeploy REST API Guide.

In this blog entry, I will demonstrate use of REST API to setup Git Integrations in FlexDeploy with inputs from CSV file. This task can be done from FlexDeploy UI, but it is good idea to use REST API to speed up the configuration process. We will use POST method of Source Control Management Instance API.

For example, I have prepared CSV file with 10 Git Integrations with columns for Code, Name and URL to be used in FlexDeploy Git Integration. In this example, I am using same user ID and password for all Git repositories but you can always adjust this script as necessary.

With FlexDeploy you can use REST API to setup Git Integrations.Adjust file (shown below) for various properties like FD_HOST, FD_PORT, FD_USER, FD_PASSWORD, GITUSER and GITPASSWORD. When you run this script, it will invoke FlexDeploy REST API to create Git Integration configurations with data from scm.csv file.

Here is sample scm.csv file.

DEMO10,Demo10, code that will use scm.csv file.



export IFS=","
cat scm.csv | while read CODE NAME GITURL
   echo Create FlexDeploy Git Connection using $CODE $NAME $GITURL
   curl -u $FD_USER:$FD_PASSWORD -i -X POST -H "Content-Type:application/json" http://$FD_HOST:$FD_PORT/flexdeploy/rest/v1/topology/integrations/scminstance -d '{"instanceName":"'$NAME'","properties":[{"propertyName":"FDGIT_URL","propertyValue":"'$GITURL'"},{"propertyName":"FDGIT_USER","propertyValue":"'$GITUSER'"},{"propertyName":"FDGIT_PASSWORD","propertyValue":"'$GITPASSWORD'"}],"scmType":"GIT","instanceCode":"'$CODE'","isActive":true}'

There are many possibilities with API, this was just a simple example for API usage.

Realted Resources

Analyze Source Code Using PMD in FlexDeploy

PMD is a static source code analyzer. It finds common programming flaws like unused variables,

OWASP Scanning in FlexDeploy

If you’ve been looking for a quick scanner that provides insight into the libraries referenced

DevOps for Oracle EBS: Workflows Tips

Companies using Oracle EBS face difficulties when they want to upgrade, migrate, or make other

Join DevOps leaders across the globe who recieve analysis, tips, and trends in their inbox