Skip to content

mw stack deploy interprets list syntax for envs incorrectly #1574

@LukasFritzeDev

Description

@LukasFritzeDev

Describe the bug
docker compose supports two ways of defining environment variables: List and mapping syntax.

Bei ihm heißt es z.B.:

        environment:
            - POSTGRES_DB=${CORE_POSTGRES_DB}
            - POSTGRES_USER=${CORE_POSTGRES_USER}
            - POSTGRES_PASSWORD_FILE=/secrets/password.txt
            - POSTGRES_HOST_AUTH_METHOD=scram-sha-256
            - POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256
        environment:
            POSTGRES_DB: "${CORE_POSTGRES_DB}"
            POSTGRES_USER: "${CORE_POSTGRES_USER}"
            POSTGRES_PASSWORD_FILE: "/secrets/password.txt"
            POSTGRES_HOST_AUTH_METHOD: "scram-sha-256"
            POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256"

These two should be equivalent. But if the List syntax is used the following envs are set up:

0=POSTGRES_DB=REDACTED
1=POSTGRES_USER=REDACTED
3=POSTGRES_PASSWORD_FILE=/secrets/password.txt
3=POSTGRES_HOST_AUTH_METHOD=scram-sha-256
4=POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256

Since there is now a backend validation to prevent this behaviour, this syntax is broken.

To Reproduce
Steps to reproduce the behavior:

  1. use mw stack deploy with a compose file that uses list syntax
  2. Command faiis with validation error

Expected behavior
Command works and envs are imported correctly

Console logs
If applicable, add console outputs to help explain your problem.

Environment (please complete the following information):

  • OS: macOS 26.2
  • Shell zsh
  • Terminal
  • Version (output of mw --version): @mittwald/cli/1.12.0 darwin-arm64 node-v20.19.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions