Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

One product with multiple keys in an app

Hi,

We have 1 APP in which there is one product. When we are deploying our proxies through Jenkins using Apigee Maven plugin, it creates another set of consumer key and secret for the same product in the same app. It means number of times you deploy it will create same number of keys for same product. How we can avoid this ? We don't want multiple keys for 1 product since any key will work.

Thanks

Solved Solved
0 12 917
1 ACCEPTED SOLUTION

Hi @nikhilchawla,

Its sort of a chicken-n-egg thing. If your using mvn command line then there's a number of options.

I have one command that does everything in one go, like when I want to deploy the proxy, create config items, export keys and test to a new org/env. That uses this command:

mvn -Ptest install -Ddeployment.suffix= \
    -Dapigee.config.options=update \
    -Dapigee.config.dir=target/resources/edge \
    -Dapigee.config.exportDir=target/test/integration \
    -Dapi.testtag=@health

Once, I've got the apps created, I use a different command to update both the proxy and config items (excluding apps and new proxy revisions). That command is:

mvn -Ptest install -Ddeployment.suffix= \
    -Dapigee.options=update \
    -Dapigee.config.options=update \
    -Dskip.apps=true \
    -Dapigee.config.dir=target/resources/edge \
    -Dapigee.config.exportDir=target/test/integration \
    -Dapi.testtag=@health 

Note the use of "-Dapigee.options=update" to overwrite the last revision instead of creating new ones.

So how do I skip "updating" Apps and generating new keys all the time? I added an option to control that phase using "-Dskip-apps=true".

<execution>
    <id>create-config-app</id>
    <phase>install</phase>                        
    <configuration>
        <skip>${skip.apps}</skip>
    </configuration>
    <goals>
        <goal>apps</goal>
    </goals>
</execution>

I use this approach to iterate quickly and to avoid exceeding limits.

Hope that helps

View solution in original post

12 REPLIES 12