Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Nov 20, 2023. It is now read-only.
This repository was archived by the owner on Nov 20, 2023. It is now read-only.

docker-compose like environment variables syntax #657

@areller

Description

@areller

What should we add or change to make your life better?

There are 3 changes I would like to have

  1. Allow to specify environment variables using the docker-compose syntax

Example:

name: demo-envvars
services:
        - name: console
          project: console/console.csproj
          env:
                  - SOME_VAR_1=SOME_VALUE
                  - SOME_VAR_2="SOME VALUE WITH SPACES"

The wouldn't replace the old syntax (having to explicitly write name and value), but only provide an alternative

  1. Allow to pass external environment variables to tye, per the docker-compose syntax

You should be able to specify the names of the environment variables you'd want to pass from the external environment (shell/etc...). Tye would read the values from the environment and pass them into the service

Example:

name: demo-envvars
services:
        - name: console
          project: console/console.csproj
          env:
                  - SOME_VAR_1
                  - SOME_VAR_2

(This should also work with the existing env vars syntax, if you specify a name without a value)

  1. Allow to specify the path to an env file, per the docker-compose syntax

The env file would have this syntax

SOME_VAR_1=SOME_VALUE
SOME_VAR_2="SOME VALUE WITH SPACES"

and to reference it in tye.yaml you would do

name: demo-envvars
services:
        - name: console
          project: console/console.csproj
          env_file:
                  - my_vars_1.env
                  - my_vars_2.env

(You would be able to specify multiple files)

Why is this important to you?

  1. The current syntax for environment variables feels overly verbose, compared to docker-compose's syntax, especially, when dealing with 5~10+environment variables.

  2. It would make it much more convenient to copy variables from docker-compose to tye or vice-versa

If this sounds fine, I can implement it. Let me know

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions