br4chu / docker-compose-maven-plugin

Maven plugin that talks to docker-compose command-line interface
Apache License 2.0
12 stars 4 forks source link

Add support for envFile #14

Open dadoonet opened 10 months ago

dadoonet commented 10 months ago

Hey

Would it be possible to add support as well to <envFile>:

<envFile>${contrib.dir}/docker-compose-it/.env</envFile>
<env>
  <STACK_VERSION>${integ.elasticsearch.version}</STACK_VERSION>
  <ELASTIC_PASSWORD>${tests.cluster.pass}</ELASTIC_PASSWORD>
  <ES_PORT>${integ.elasticsearch.port}</ES_PORT>
  <ENTERPRISE_SEARCH_PORT>${integ.workplace.port}</ENTERPRISE_SEARCH_PORT>
  <LICENSE>trial</LICENSE>
</env>

In my project, my .env file is automatically generated like this:

# THIS FILE IS AUTOMATICALLY GENERATED FROM /contrib/src/main/resources/xxx DIR.

# Password for the 'elastic' user (at least 6 characters)
ELASTIC_PASSWORD=changeme

# Password for the 'kibana_system' user (at least 6 characters)
KIBANA_PASSWORD=changeme

# Version of Elastic products
STACK_VERSION=8.11.0

# Set the cluster name
CLUSTER_NAME=docker-cluster

# Set to 'basic' or 'trial' to automatically start the 30-day trial
#LICENSE=basic
LICENSE=trial

# Port to expose Elasticsearch HTTP API to the host
ES_PORT=9200

# Port to expose Kibana to the host
KIBANA_PORT=5601

# Enterprise Search settings
ENTERPRISE_SEARCH_PORT=3002
ENCRYPTION_KEYS=q3t6w9z$C&F)J@McQfTjWnZr4u7x!A%D

# Increase or decrease based on the available host memory (in bytes)
MEM_LIMIT=1073741824

# Project namespace (defaults to the current folder name if not set)
COMPOSE_PROJECT_NAME=fscrawler

That way, I could just specify what I need to overwrite in the pom.xml and keep it as simple as possible.

Let me know ;)