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

question regarding description string #141

Open
hjw opened this issue Dec 4, 2021 · 1 comment
Open

question regarding description string #141

hjw opened this issue Dec 4, 2021 · 1 comment

Comments

@hjw
Copy link

hjw commented Dec 4, 2021

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?

@bibendi
Copy link
Owner

bibendi commented Dec 4, 2021

Hi!
Good idea. I'll add this in the next release.

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