fabric8io/fabric8

Multiple ports not binding correctly. Trying to use Localtacks's S3 and DynamoDB endpoints, but only Dynamo works properly.

Opened this issue · 0 comments

I'm trying to use Localstack's Dynamo and S3 endpoints for integration tests. But for some reason I can only get Dynamo to work properly. I set up the dynamo and S3 endpoints the same, and I think I have the POM set up correctly. What else could I be missing to get this to work properly?

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>reserve-dynamo-port</id>
                    <phase>process-resources</phase>
                    <goals>

                        <goal>reserve-network-port</goal>
                    </goals>
                    <configuration>
                        <portNames>
                            <portName>s3.port</portName>
                            <portName>dynamo.port</portName>

                        </portNames>
                    </configuration>
                </execution>

            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>

                <systemProperties>
                    <s3.uri>http://localhost:${s3.port}</s3.uri>
                    <dynamo.uri>http://localhost:${dynamo.port}</dynamo.uri>
                </systemProperties>
            </configuration>
        </plugin>
        <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <executions>
                <execution>
                    <id>initialize-integration-dynamo</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start</goal>
                    </goals>
                    <configuration>
                        <images>
                            <image>
                                <name>localstack/localstack</name>
                                <alias>localstack</alias>
                                <run>
                                    <ports>
                                        <!-- Maps Dynamo Internal Port to a Random Port -->
                                        <port>${dynamo.port}:4569</port>
                                        <port>${s3.port}:4572</port>
                                    </ports>
                                    <wait>
                                        <log>Ready.</log>
                                        <time>30000</time>
                                    </wait>
                                </run>

                            </image>
                        </images>
                    </configuration>
                </execution>

                <execution>
                    <id>teardown-integration-dynamo</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>