Continuous Integration and Continuous Delivery with CA API Gateway and Jenkins | Integrate
Integrate Blog

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.

Subscribe to the Integrate Weekly Digest

* indicates required

9 thoughts on “Continuous Integration and Continuous Delivery with CA API Gateway and Jenkins

  1. 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.

    Reply
  2. 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

    Reply

Leave a Reply

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

Perficient Integrate Blog

Insights on the application of complex systems and processes that drive your business forward. Immediately apply value and optimize your integration program whether built around APIs, SOA, BPM, DevOps, or cloud.

Archives