{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
1
Question by Berend van Waalwijk · Jul 10, 2019 at 08:52 AM · 240 Views maven deploy plugincicdmaven plugin

Separating proxy and config deployment using maven plugin

The CICD pipeline we use, uses the maven apigee plugin to deploy configs, proxies and shared flows. As per the folder structure, the edge.json (configs) is in the same repo as the proxy.

we make a push to scm. This triggers the pipeline which goes through both plugins. The one for config and the one for proxy.

My question/problem is as follows: How to only deploy configs when a change is made to them without running the proxy deployment (or vice versa)? We can of course do diff checks in git, but is there an easy solution to this?

Comment
Add comment Show 1
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Siddharth Barahalikar   · Jul 10, 2019 at 09:16 AM 0
Link

The difference between Config and Proxy deployement is the addition of prepare-package, package and deploy phases in shared-pom.xml.

Maybe we can create a couple of profiles with special activation conditions to deploy only config or both config & proxy.

Note - I guess it should work, but I have not tried it yet.

Close

1 Answer

  • Sort: 
avatar image
1
Best Answer

Answer by Kurt Googler Kanaskie · Jul 10, 2019 at 03:29 PM

Hi @Berend van Waalwijk, great question!

As I see it, you have 2 options:

  1. Create a separate repo for your config items as described in the EdgeConfig sample in https://github.com/apigee/apigee-config-maven-plugin. Probably overkill for typical proxy config items.
  2. Use a script to detect changes to edge.json or resources directory and set env variable to be used on the mvn build command.

For option 2, I used this script to detect changes on the last commit.

#! /bin/bash

ConfigChanges=`git diff --name-only HEAD HEAD~1 | grep "edge.json"`
if [[ $? -eq 0 ]]
then
	export EdgeConfigOptions="update"
else
	export EdgeConfigOptions="none"
fi

# Redirect output from this script to an "edge.properties" file in Jenkins. 
echo EdgeConfigOptions=$EdgeConfigOptions

Then, in Jenkins inject the env variables and use them on the mvn command.

Thanks for the question, this makes for a nice addition to my best practices!


screen-shot-2019-07-10-at-112625-am.png (67.3 kB)
Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Berend van Waalwijk · Jul 11, 2019 at 06:33 AM 0
Link

Thanks a lot Kurt. This answers my question as for the option being there in built in the plugin. More thanks for the provided script. We'll implement this in our groovy script on which the pipeline runs.

Follow this Question

Answers Answers and Comments

51 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to determine a particular proxy change in a Git repo with N number of proxies 1 Answer

Automate bundle creation using openAPISpec + add necessary policies + push it to edge - cicd using Azure Devops 1 Answer

Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 operation time out 0 Answers

CICD Jenkins - Undeploy the revision to earlier deployed revision 3 Answers

maven plugin package and deploy 0 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges