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

Additional command for container startups #623

Open
artemptushkin opened this issue Feb 26, 2021 · 0 comments
Open

Additional command for container startups #623

artemptushkin opened this issue Feb 26, 2021 · 0 comments

Comments

@artemptushkin
Copy link
Contributor

artemptushkin commented Feb 26, 2021

Some cases might require an additional command on the container start-up.
In general, it could be quite an often case to execute an additional command on the testcontainers start.

Currently, if we configure com.playtika.test.common.properties.CommonContainerProperties #command it will override the default command.

I would suggest adding an additional property like additionalCommands and if it is notNull pass it with withCommand:

new GenericContainer(properties.getDockerImage())
                .withExposedPorts(properties.getPort())
                .withCommand(
                        "/bin/sh",
                        "-c",
                        format(
                                "gcloud beta emulators pubsub start --project %s --host-port=%s:%d",
                                properties.getProjectId(),
                                properties.getHost(),
                                properties.getPort()
                        ),
                   additionalCommands
                )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants