Maven plugin - Consistent deployment

Hello Team,

As a part of testing the deployment, we have observed that, proxy deployment consistency have challenges. For example, i have a KVM and Target servers in edge.json files. However due to KVM goal unavailable in POM.XML , my proxy getting deployed but without KVM.

Is there a way that, proxy deployment should be done if all the validations like KVM creation, target server creation is available according to edge.json.

Also, some times, the KVM and target servers getting created, however, due to some other issue, proxy deployment is failed then KVM's and target servers are redundant, is there a way to roll back the created objects of that deployment if proxy deployment fails ?

@ssvaidyanathan Please support here.

 

Regards,

Murthy.

Solved Solved
0 3 181
1 ACCEPTED SOLUTION

@Murthy - This is not related to Apigee nor the Apigee plugin. This is a Maven question that you are asking. The only difference between the two snippets is the use of "encoding". You can find more info about it here.

View solution in original post

3 REPLIES 3

@Murthy - The proxy deployment will still continue even if the KVMs are not available. I would recommend you have all the necessary goals in your pom.xml.. The plugin picks it from edge.json or skips it if it cant find any config. So please include all necessary goals in your pom.xml. With that you are certain that all the configurations are pushed before the proxy is deployed. 

Yes - you can trigger another pipeline if the automated test cases fail. And in that pipeline you can call the config plugin with the "delete" option so that it goes ahead and deletes those configuration. Usually I don't recommend this as those configurations (target server, KVM) could be used by other proxy. In your case, if thats not the case, then you can just trigger another pipeline when the build fails.

Hello @ssvaidyanathan ,

 

My current plugin have like this

 

 

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<encoding>UTF-8</encoding>
<echo message="basedir parent : ${basedir}"/>
<outputDirectory>${basedir}/target/sharedflowbundle</outputDirectory>
<resources>
<resource>
<directory>sharedflowbundle</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>

 

 

However, i saw a suggestion to update it like below, does update to below would change the behaviour, what's the new feature provided by below change . Could you please explain here

 

<plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.6</version>
    <executions>
        <execution>
            <id>copy-resources</id>
            <phase>package</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                 <!--this is important -->
                <overwrite>true</overwrite>
                 <!--target -->
                <outputDirectory>${target.root.dir}/apiproxy</outputDirectory>
                <resources>
                    <resource>
                         <!--source -->
                        <directory>${project.root.dir}/apiproxy</directory>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>

</plugin>

@Murthy - This is not related to Apigee nor the Apigee plugin. This is a Maven question that you are asking. The only difference between the two snippets is the use of "encoding". You can find more info about it here.