DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Databases
  4. CI/CD For API Development [WSO2 API Manager 2.6.0]

CI/CD For API Development [WSO2 API Manager 2.6.0]

Lean how to use the plugin in your Maven Based projects to achieve the CI/CD.

Anupam Gogoi user avatar by
Anupam Gogoi
·
Dec. 14, 18 · Tutorial
Like (1)
Save
Tweet
Share
15.28K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction 

WSO2 API Manager is a complete platform for lifecycle management of APIs. Although the API Manager comes with a built-in module to publish APIs, it's not possible to apply CI/CD. To compensate this the API Manager provides a set of useful REST APIs and by using these APIs a CI/CD pipeline can be built easily.

Maven Plugin 

I have created a Maven Plugin using the exposed REST APIs and in this article, I will be showing how to use the plugin in your Maven Based projects to achieve the CI/CD. Please feel free to download/clone the plugin and modify it according to your needs.

Prerequisites 

The plugin is created using the REST APIs exposed by WSO2 API Manager 2.6.0. So, to execute the CI/CD demo in the below section, you must have WSO2 API Manager 2.6.0 up and running.

Scenario 

We are implementing an API in a Java project (Maven based). When the implementation is done, we push the code to the Github. We define a pipeline in Jenkins server where we configure our Maven plugin to execute. On successful execution of the plugin, the API of our project (swagger.yaml) is published in the WSO2 API Manager (2.6.0). 

Create a Simple Project

The complete source code of the API implementing project i.e blog-api can be found here.

project

Here is a snapshot of the pom.xml:

Image title

Note that in the pluginRepository I am pointing it to a public bitbucket repository for this demo. Feel free to clone/download the Plugin and install in your local repository. The plugin configuration is quite straightforward. 

Jenkins Configuration

Download Jenkins and run it. Download the Maven Integration plugin and then configure it under 

Jenkins -> Global Tool Configuration.

Image title

Create a Pipeline Project

Click New Item and create a Pipeline project.

Image title

Set the Build Trigger to every minute as shown below,

Image title

Here is a simple three staged pipeline definition.

Image title

Check details of how to use the Maven Plugin in the plugin documentation.

Execution

Commit and push changes of the blog-api project to Github. The Jenkins is polling on the GitHub repository every minute and the pipeline will be executed automatically. After successful execution of the pipeline, the API configured in the plugin will be published in the API Manager. (Make sure that the API Manager is running)

Conclusion

In this article, I have shown how easily the REST APIs of the WSO2 API Manager can be used to build a CI/CD pipeline. The plugin is very simple (for demo purpose), but feel free to make changes to it to adapt to your requirements.

API Continuous Integration/Deployment

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 5 Tips for Optimizing Your React App’s Performance
  • The Enterprise, the Database, the Problem, and the Solution
  • How to Configure AWS Glue Job Using Python-Based AWS CDK
  • How to Cut the Release Inspection Time From 4 Days to 4 Hours

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: