Skip to content

question regarding description string #141

Description

@hjw

I'd like to have my description strings be able to access environment variables.
I'd also like to be able to set my other variables, like my database name.

Use case. In my dip.yml file I set a variable that compose uses, which works fine, but I'd like to be able to have the string printed with dip ls reflect that port number, and I'd like to pass in the db name to the pgsql service:

environment:     
  RAILS_ENV: development             
  EXPOSED_RAILS_PORT: 3004
  DB_NAME:my_db
<snip> 
subcommands:
      s:
        description: Run Rails server available at http://localhost:${EXPOSED_RAILS_PORT}
        service: rails
        compose:
          run_options: [service-ports, use-aliases]

  psql:
    description: Run psql console
    service: postgres
    # Because this is a rails project, the name of the database
    # (project_dev) is set in config/database.yml
    # command: env PGPASSWORD=postgres psql -h postgres -U postgres -d project_dev
    command: env PGPASSWORD=postgres psql -h postgres -U postgres -d ${DB_NAME}

This doesn't work now, I believe because the variables set under environment are only used as pass throughs to docker-compose. It would be great if I could access them in my description strings though.
Any thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions