Need help on configuring Continuous Integration and deployment to Apigee

Hi,

I followed the instructions on https://github.com/dzuluagaapigee/apigee-ci-jenkins-git-maven-jmeter to setup jenkins to pull code from git and deploy to apigee.

I did verify that the jenkins job completed successfully and the api proxy was deployed to my apigee org, i had to just add the -D org option to the goal commandline.

Is this using the apigee maven plugin?

If I have to customize this to deploy my api proxies what are the config changes needed? Do i need to maintain a pom.xml and config.json for each api proxy in my source control?

Is there any specific folder structure that needs to be maintained in Git for the locations of the pom and the config.json file?

Solved Solved
1 5 2,271
1 ACCEPTED SOLUTION

Not applicable

Hi Nagashree,

I'm glad that you tried the plugin and integrated it with Jenkins and made it to work. And you're right, it leverages Apigee Deploy Maven Plugin. You just need to change parameters under shared-pom.xml file, here's the link to it. So, given that you want to try to customize it with your own org and Git repo, you can point your Jenkins instance to either a public or private (you'll need to setup SSH keys, but it works too) repo. A quick hint, fork the repo and change configuration as needed if you want a quick test. As for the folder structure, you'll need to stick to it. Here's a the tree of the actual structure:

.
├── forecastweatherapi
│   ├── apiproxy
│   │   ├── forecastweatherapi.xml
│   │   ├── policies
│   │   │   ├── Assign-Message-1.xml
│   │   │   ├── xmltojson-1.1.xml
│   │   │   └── xmltojson-1.xml
│   │   ├── proxies
│   │   │   └── default.xml
│   │   └── targets
│   │       └── default.xml
│   ├── config.json
│   ├── pom.xml
│   └── tests
│       ├── weather.jmx
│       ├── weather_prod.csv
│       └── weather_test.csv
└── shared-pom.xml 

Let me know if you have any questions or anything is missing.

Cheers,

Diego

View solution in original post

5 REPLIES 5

Not applicable

Hi Nagashree,

I'm glad that you tried the plugin and integrated it with Jenkins and made it to work. And you're right, it leverages Apigee Deploy Maven Plugin. You just need to change parameters under shared-pom.xml file, here's the link to it. So, given that you want to try to customize it with your own org and Git repo, you can point your Jenkins instance to either a public or private (you'll need to setup SSH keys, but it works too) repo. A quick hint, fork the repo and change configuration as needed if you want a quick test. As for the folder structure, you'll need to stick to it. Here's a the tree of the actual structure:

.
├── forecastweatherapi
│   ├── apiproxy
│   │   ├── forecastweatherapi.xml
│   │   ├── policies
│   │   │   ├── Assign-Message-1.xml
│   │   │   ├── xmltojson-1.1.xml
│   │   │   └── xmltojson-1.xml
│   │   ├── proxies
│   │   │   └── default.xml
│   │   └── targets
│   │       └── default.xml
│   ├── config.json
│   ├── pom.xml
│   └── tests
│       ├── weather.jmx
│       ├── weather_prod.csv
│       └── weather_test.csv
└── shared-pom.xml 

Let me know if you have any questions or anything is missing.

Cheers,

Diego

Thanks Diego, i will try this and get back to you. So, every API proxy should have a pom.xml? Can we have one POM for all api proxies? i am trying my hand it. I will let you know if i succeed.

Not applicable

That's correct. Each proxy has a pom.xml.

And I think I see where you're coming from, you may want to deploy all api proxies in a single shot. I've been asked the same question before, however I think it's unnecessary. It'd be possible by somehow tweaking the pom.xml or share-pom.xml, I haven't tried though. However, the trend I've seen with most customers is to treat each API as single deployable unit independent from other APIs, by doing so, you can manage (debug, isolate issues, and version control) each api by a separate team achieving better separation of concerns and deliver code faster in a continuous delivery fashion. Essentially, each API represents a microservice instead of a big monolith app, which requires deployment of every single component under the same version.

In case you want to explore additional flexibility, I'd recommend trying Apigee Deploy Grunt Plugin, which provides additional facilities for code reviews, TDD and BDD with Mocha, Java policies integration, SmartDocs documentation publishing, easy to setup custom tasks, etc.

Thanks again Diego for your input. I was able to use the maven aggregator to tweak the main pom file and deploy multiple proxies at once. although i still have one pom file per proxy which seemed simpler than using a single pom file and putting everything in an iterator.

@Nagashree B

Even we are trying to deploy multiple proxies in one go . Each proxy has its own pom file . As of now in Jenkins Job Configuration , we have given "Root POM" path as individual proxy's pom . This deploys only a single proxy .

How can we tweak the parent-pom and what should we give in "Root POM" configuration if we want multiple proxy deployment .

We have used following parent-pom xml configuration to add multiple modules for deployment :

<modules><module>apigee-proxy1</module><module>apigee-proxy2</module></modules>

where apigee-proxy 1 , apigee-proxy 2 etc are the API proxies which needs to be deployed and contains individual pom (child pom).

Any help will be appreciated.