-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fine-grained control to retaining plugin executions on master #137
Fine-grained control to retaining plugin executions on master #137
Conversation
…rol to retain only specific execution of a plugin as well.
I really like this. Thanks! |
Thanks @glimmerveen, today I will have the time to testing it. But I will test it tomorrow. |
I tested the retained execution in my docker gitworkflow example. It works. Details: I defined in the pom an execution in the maven-antrun-plugin that copies the Docker images from a staging Docker registry into the release Docker registry: <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-from-stage-to-release</id>
<goals>
<goal>run</goal>
</goals>
<phase>deploy</phase>
<configuration>
<skip>${docker.skip.deployToRelease}</skip>
<target>
<exec executable="docker" failOnError="true">
<arg line="${docker.globalArgs}"/>
<arg value="pull"/>
<arg value="dockerregistry-stage.example.com/${project.groupId}/${docker.artifactId}:${project.version}"/>
</exec>
<exec executable="docker" failOnError="true">
<arg line="${docker.globalArgs}"/>
<arg value="tag"/>
<arg value="dockerregistry-stage.example.com/${project.groupId}/${docker.artifactId}:${project.version}"/>
<arg value="dockerregistry-release.example.com/${project.groupId}/${docker.artifactId}:${project.version}"/>
</exec>
<exec executable="docker" failOnError="true">
<arg line="${docker.globalArgs}"/>
<arg value="push"/>
<arg value="dockerregistry-release.example.com/${project.groupId}/${docker.artifactId}:${project.version}"/>
</exec>
</target>
</configuration>
</execution>
</executions> In the gitflow-helper-maven-plugin put this execution onto the retainPlugins list: <plugin>
<groupId>com.e-gineering</groupId>
<artifactId>gitflow-helper-maven-plugin</artifactId>
<configuration>
...
<retainPlugins>
<retainPlugin>org.apache.maven.plugins:maven-antrun-plugin:copy-from-stage-to-release</retainPlugin>
</retainPlugins>
...
</configuration>
</plugin> The master build copies now the Docker image from the stagine Docker registry to the release registry:
|
@rhierlmeier : good to hear that it is working in your setup! |
Refactored how the MasterPromoteExtension prevents plugins to execute, allowing more fine-grained control allowing specific plugin executions to run on master, but not necessarily all executions of a single plugin.
This refines an earlier addition #129, and should address #136