This change implements support for the COMPOSE_PROFILES environment
variable, allowing users to specify active Compose profiles through their
environment.
The behavior is as follows:
- Profiles from COMPOSE_PROFILES (comma-separated) are activated.
- Both the environment variable and the --profile CLI flag can be used
together, with the resulting set of active profiles being the union of
both.
Signed-off-by: Watson Dinh <ping@w47s0n.com>
This is not present in the compose spec. However, netavark podman
network backend does support --route option, which is useful for various
kinds of things. It is very easy to expose it.
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
Renamed directory `build_fail_multi` to more appropriate
`commands_fail_exit_code` as more tests were added to other
commands:`push` and `run`. Names of tests were changed accordingly.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Failure exit code for `push` command is not currently forwarded as exit
code for podman-compose.
With this PR, podman-compose stops pushing when the underlying podman
command fails and forwards its exit code.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
`podman-compose` currently does not support interpolating environment
variables in dictionary keys, despite the compose file specification
indicating this capability.
See the relevant compose-spec documentation:
https://github.com/compose-spec/compose-spec/blob/main/12-interpolation.md
This feature is useful in `labels` or `environment` sections, where keys
can be user-defined strings. To enable interpolation, an alternate equal
sign syntax must be used, e.g.:
services:
foo:
labels:
- "$VAR_NAME=label_value"
After this PR `podman-compose` will align more closely with the compose
file specification, allowing for the interpolation of environment
variables in dictionary keys.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
This commit allows compose file to directly use environment variable
values in "environment:" section when variables were set in `.env` file.
This functionality was missing, as docker-compose supports both: short
and variable interpolation syntax forms:
environment:
- FOO
and
environment:
- FOO=${FOO}
Relevant docker-compose documentation:
https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/
podman-compose is more compatible with docker-compose after this change.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
After changes in 92f0a8583a, the
dockerfile parameter is igored if the (local) work directory's name ends
in `.git`.
This commit fixes the regression and adds more tests.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
e03d675b9b broke relative host path
resolution by deleting os.chdir(). After this commit current working
directory is not relevant anymore.
Fixes e03d675b9b.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Current error message does not provide the exact path where the
Dockerfile is being searched.
This commit distinguishes two types of errors when Dockerfile is not
found in build context:
- when the context does not have provided custom-named Dockerfile, the
path in the error message is absolute: "OSError: Dockerfile not found in
.../podman-compose/tests/integration/build_fail/context_no_file/custom-named-Dockerfile"
- when the context does not have any Dockerfile, the path in the error
message is: "OSError: Dockerfile not found in
.../podman-compose/tests/integration/build_fail/context_no_file"
Only this error message was used before the fix.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Co-authored-by: Siteshwar Vashisht <svashisht@redhat.com>
Tests were not run due to missing __init__.py files.
This commit adds missing files and fixes paths to compose.yaml files.
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Skip dependency health check to avoid compose-up hang for podman prior
to 4.6.0, which doesn't support --condition healthy.
Signed-off-by: Justin Zhang <schnell18@gmail.com>