Skip to content
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

Support including parameterized tile multiple times #74

Open
udalrich opened this issue Nov 21, 2017 · 1 comment
Open

Support including parameterized tile multiple times #74

udalrich opened this issue Nov 21, 2017 · 1 comment

Comments

@udalrich
Copy link

I would like to define a tile that starts a docker container for use during integration tests. I can do that easily enough by creating a tile that uses the appropriate plugin.

In some cases, I need to start multiple docker containers (e.g., message broker and a db). In that case, it appears that I need to copy the tile for the first container and make the slight changes to start the second container. It would eliminate duplication if I could do something like

start-docker/tile.xml

<project><build><plugins><plugin>
       group, artifact and version
       <executions>
          <execution>
            <goal>start-container</goal>
            <configuration>
                 <image>@imageName@</image
            </configuration
         </execution>
         <!-- Other executions -->
       <executions>
   </plugin></plugins></build></project>

start-db/tile.xml

<project>
      <tiles>
          <tile>
             <source>me:start-docker:1.0<source>
             <properties>
                  <imageName>db</imageName>
             </properties>
          </tile>
      </tiles>
 </project>

start-msg-broker/tile.xml

<project>
      <tiles>
          <tile>
             <source>me:start-docker:1.0<source>
             <properties>
                  <imageName>msg-broker</imageName>
             </properties>
          </tile>
      </tiles>
 </project>

component/pom.xml

...
         <plugin>
            <groupId>io.repaint.maven</groupId>
            <artifactId>tiles-maven-plugin</artifactId>
            <version>2.10</version>
            <configuration>
                <filtering>true</filtering>
                <tiles>
                    <tile>me:start-db:1.0</tile>
                    <tile>me:start-msg-broker:1.0</tile>
                </tiles>
            </configuration>
        </plugin>

Alternatively, if there was a way to override the location of tile.xml, then I could import the tile in start-db/pom.xml and do the filtering before the tile plugin ran. I suppose that I could create the tile.xml in that manner, but that is likely to be confusing, as I would have a build product outside of target.

@rvowles
Copy link
Member

rvowles commented Nov 22, 2017

All the tiles are doing are side-loading and creating an inheritance structure - so your properties will be overwritten and you would still only have one docker image.

Have you tried just defining the same plugin but with a different execution (with its own id) and have the plugin merge them? Thats what it should do. You should end up with one plugin in your effective pom with 2 executions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants