Skip to main content

Integration & IT Modernization

Continuous Integration and Continuous Delivery with CA API Gateway and Jenkins

Many companies are modernizing their systems as part of mobilization and digitization of the business. DevOps concepts are being employed to increase the delivery velocity of modern applications to the business. With DevOps it is critical to automate all aspects of Continuous integrationdeploying new software features. The time required for manual steps adds up and defeats DevOps goals. In the example below, we have automated API and policy management to speed deployment, introduce continuous integration concepts and place API artifacts under source code management.

In an effort towards modernization of the API and the organization moving towards Agile from traditional waterfall, DevOps is becoming essential in making sure the development and operations team work towards a common goal. Achieving continuous integration and delivery is key and is aided by multiple tools in the market. As each organization builds APIs for easy consumption and monetization, continuous integration and delivery is integral part of the solution to enable fast to market.

The following steps depict how you can achieve continuous integration and delivery for CA API Gateway, which is widely used across multiple industry for exposing APIs and more importantly to secure the APIs:

  1. Develop a policy in policy manager
  2. Export a Policy: Export the policy xml using headless java utility called Gateway Migration Utility, available from CA, and check in the artifacts
    1. Create an argFile.properties with below arguments

      host – host name of the gateway from which the policy has to be exported

      port – Port number to connect to the gateway

      username – username to connect to the gateway

      password – encoded password of the gateway

      format – specify as single file if the export is for policy file or folder for a folder

      dest= policy XML name for storing the XML

      serviceName= Actual Policy name in the gateway

      encryptionPassphrase – Passphrase for encryption

  3. Before export , validate the connection to the gateway is successful using gateway migration utility command below
    1. GatewayMigrationUtility.sh browse -z argFile.properties -r –showIds – this should list all the policies running in the gateway.
  4. Migrate out the policy from the gateway by using the gateway utility command below
    1. GatewayMigrationUtility.sh migrateOut –argFile argFile.properties
  5. Externalize the variable with the values from the exported policy xml using the below command
    1. GatewayMigrationUtility.sh template –bundle policyAPI.xml –template policyTemplate-.properties – This will create the template properties file with the key / value pair having variable names and corresponding values, and the values in the file can be modified with specific environment properties.
  6. Create a Mapping file for the mappings. These are used to specify the action to be used for a given type and the srcId when importing to different environments.
    1. Copy the mappings section from the bundle file
    2. Save the mappings as policyAPIMappings.xml
    3. Modify the properties for the type as required
  7. Check in the policy XML, Mappings XML, argFile properties file, and template property files to the code repository
  8. Import a Policy: Configure Jenkins to poll the files for the policy from code repositoryJenkins1
  9. Package the artifacts (policy XML , mappings XML , argFile and template properties file ) to artifactory or any build file storageJenkins2
  10. Configure  SSH to send the files over to build server and execute the migrate in command as belowJenkins3
  11. Configure the test cases for the policy as an test suite to execute the test cases after the migration to the target gateway and publish the results

 

Note: The above example uses credentials (username/password) of the gateway to import and export the policy out of gateway. You can do this using the certs as a mechanism to import /export the policy.

Reference: CA API Gateway Documentation

It is necessary to automate deployment for all components to optimize the velocity of software innovation. In the example above we have eliminated a manual step associated with API deployment.

Tags

Thoughts on “Continuous Integration and Continuous Delivery with CA API Gateway and Jenkins”

  1. jamsheed.Chittan

    Hi Anand,

    Nice post. I am also working on CA API Gateway. I would request you to share more details on CI/CD. Please message me on linkdin if you can.

    Regards,
    Jamsheed Chittan

  2. This article is very useful , who want to learn DevOps. DevOps is a development methodology with a set of practices aimed at reducing the time between Development and Operations. Now a days DevOps is best future career for students.

  3. I have read your blog andI got very useful and knowledgeable information from your blog. It’s really a very nice article. You have done a great job.

  4. My biggest problem for the process is the step 6:
    1.Copy the mappings section from the bundle file
    2.Save the mappings as policyAPIMappings.xml
    3.Modify the properties for the type as required

    Those are very manual involved to cut paste a section to create a file and manually identify the ids that need to mapped when environment are different in the ids generated by the deployment. I have not find a good way to automate the things. Can a better way provided to achieve this? Anyway expose internal gateway goid to DevOp people is not an ideal practice. It should be only be used by internal gateway program.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Anandh Asokan

Experienced IT professional in digital and consulting services, technology to help clients deliver values for their customers, defined and developed integration products (API, Event streams, and bulk load assets), Data (Data ingestion to analytics pipeline, MDM). A thought leader in defining a strategy with a pragmatic approach for the organization transformation. He has delivered high-quality products in various technologies and industry domains with a reputation in execution and mentorship. Passionate engineering professional with a Bachelor's degree focused in Computer science and a Master's degree in Software Engineering !.

More from this Author

Follow Us