adelf / idea-php-dotenv-plugin

environment parameters completion, based on .env file keys
MIT License
166 stars 13 forks source link

Implement Docker environments extraction #3

Closed Haehnchen closed 7 years ago

Haehnchen commented 7 years ago

Add support for enviroment of some common docker pattern. Please feedback before implementation there is a way i am doing it.

docker-compose.yml

web:
  environment:
    - DEBUG=1

docker-compose.yml

services:
  foobar:
    environment:
      - DEBUG=1

Dockerfile

ENV abc=hello
ENV abc=bye def=$abc
ENV ghi=$abc
adelf commented 7 years ago

@Haehnchen I see Docker and YAML plugins as a standard plugins for PhpStorm... so no problems here. I'm open for any advices :) . Thanks for good idea.

Haehnchen commented 7 years ago

its not about Docker and YAML is about the environment variables they provide. In additional to .env also extract values of given examples to provide support for them in getenv('DEBUG') and getenv('abc')

adelf commented 7 years ago

@Haehnchen I got it. I mean, these plugins already implemented languages for YAML and Dockerfile files, so it will be easy to use it.

Haehnchen commented 7 years ago

fyi: see DotEnvUtil.java https://github.com/Haehnchen/idea-php-symfony2-plugin/commit/d1853ff3c18b24a4acccf01685d1787460ce3d45

adelf commented 7 years ago

First draft pushed. Dockerfile support only. There are still a lot of work. I'm going to implement optional depending for Docker and YAML plugins. And also add needed extensionPoints.

adelf commented 7 years ago

In docker-compose.yml file can be two kind of env variables desclaration:

environment:
  RACK_ENV: development
  SHOW: 'true'
  SESSION_SECRET:

environment:
  - RACK_ENV=development
  - SHOW=true
  - SESSION_SECRET

Both of them implemented in 0.3 version. Currently it's in Jetbrains approval.