Grunt Apigee Deployment File Structure

Hi

I have been trying to deploy api through grunt from jenkins. I found this repo from github useful and tried to deploy it .

https://github.com/apigeecs/apigee-deploy-grunt-plugin

I deployed the forecastweather-grunt-api proxy when i ran the grunt command. However i was trying another api in similar way . With the existing folder structure i would like to add one more api and deploy both at the same time. I am not able to understand where to add the another api.

Can someone helpme out with the folder structure for api deployment using grunt?

Where should i add another api in the existing structure in the repo and how to deploy both api at the same time.

Help would be appreciated.

Solved Solved
0 1 353
1 ACCEPTED SOLUTION

Not applicable

Apigee Grunt supports one proxy per folder purposely. However, you can replicate the same structure as many times as you need to. It'd be a bit redundant because each proxy will have duplicates of node_modules and a few other folders. However, that structure guarantees that there are no dependencies with other proxies.

So, I'd suggest if you want to deploy multiple proxies at the same time, it's to leverage either a shell or tiny Node.js script that make the calls to each folder that calls grunt CLI directly from each folder. This way you don't need to worry about of building a monolith deployment build script that overtime may become more brittle.

For instance, your folder structure would end up looking like this:

.
├── deploy-all.sh
├── customers-api
│   ├── Gruntfile.js
│   ├── README.md
│   ├── apiproxy
│   ├── config
│   ├── package.json
│   └── tests
|
├── orders-api
│   ├── Gruntfile.js
│   ├── README.md
│   ├── apiproxy
│   ├── config
│   ├── package.json
└── └── tests


That being said, I'd love to get your thoughts on this.

View solution in original post

1 REPLY 1

Not applicable

Apigee Grunt supports one proxy per folder purposely. However, you can replicate the same structure as many times as you need to. It'd be a bit redundant because each proxy will have duplicates of node_modules and a few other folders. However, that structure guarantees that there are no dependencies with other proxies.

So, I'd suggest if you want to deploy multiple proxies at the same time, it's to leverage either a shell or tiny Node.js script that make the calls to each folder that calls grunt CLI directly from each folder. This way you don't need to worry about of building a monolith deployment build script that overtime may become more brittle.

For instance, your folder structure would end up looking like this:

.
├── deploy-all.sh
├── customers-api
│   ├── Gruntfile.js
│   ├── README.md
│   ├── apiproxy
│   ├── config
│   ├── package.json
│   └── tests
|
├── orders-api
│   ├── Gruntfile.js
│   ├── README.md
│   ├── apiproxy
│   ├── config
│   ├── package.json
└── └── tests


That being said, I'd love to get your thoughts on this.