This example demonstrate a sample CI/CD pipeline for API Management using WSO2 API Management solution combined with Travis CI and Newman.
This is implemented based on the solution done by manjulaRathnayaka for WSO2 API Cloud. Full credits goes to him!.
-
Fork this git repository.
-
Configure Dev environment.
Update DevEnvironment/Development.postman_environment.json to set your Dev Environment's servlet URL (serverURL), gatewayURL.
-
Configure Staging environment.
Update StagingEnvironment/Staging.postman_environment.json to set your Staging Environment's servlet URL (serverURL), gatewayURL.
-
Commit and push above changes to git repository.
-
Configure Travis
-
Go to https://travis-ci.org/ and sign in with Github.
-
Allow permissions to let travis to access your forked repository.
-
Go to your profile and select the GitHub account and the forked repository to enable building your repository.
-
If the build is not started yet, commit a minor change to your git repository to start it.
-
That is it. Now you can refer the build log to understand the execution flow. Note that this is a very simple .travis.yml configuration and you may use advanced features of travis to configure different states etc.
Now the API should be deployed in both Dev and Staging environments. Now let’s do some changes to the API and propagate those changes to Dev, Staging environments.
-
Update the swagger file at DeployAPI/swagger.json. Note that you need to have info section in swagger file.
-
Commit and push all above changes and monitor the travis build.