File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed 
testcontainers-concord-core/src/main/java/ca/ibodrov/concord/testcontainers Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 2828import  org .testcontainers .lifecycle .Startable ;
2929
3030import  java .nio .file .Path ;
31- import  java .util .ArrayList ;
32- import  java .util .Arrays ;
33- import  java .util .List ;
34- import  java .util .Map ;
31+ import  java .util .*;
3532import  java .util .function .Supplier ;
3633
3734@ SuppressWarnings ({"unchecked" })
@@ -71,6 +68,8 @@ public class Concord<T extends Concord<T>> implements AutoCloseable {
7168
7269    private  List <MountPoint > agentBindMounts ;
7370
71+     private  Map <String , String > agentEnvironment ;
72+ 
7473    /** 
7574     * Starts a Concord instance using the current configuration. 
7675     */ 
@@ -491,6 +490,18 @@ public List<MountPoint> getAgentBindMounts() {
491490        return  this .agentBindMounts ;
492491    }
493492
493+     public  T  agentEnv (String  name , String  value ) {
494+         if  (this .agentEnvironment  == null ) {
495+             this .agentEnvironment  = new  HashMap <>();
496+         }
497+         this .agentEnvironment .put (name , value );
498+         return  (T ) this ;
499+     }
500+ 
501+     public  Map <String , String > agentEnvironment () {
502+         return  this .agentEnvironment ;
503+     }
504+ 
494505    /** 
495506     * Utilities to work with T processes. 
496507     */ 
Original file line number Diff line number Diff line change @@ -135,6 +135,10 @@ public DockerConcordEnvironment(Concord<?> opts) {
135135            opts .getAgentBindMounts ().forEach (m  -> agent .withFileSystemBind (m .getSource (), m .getDest ()));
136136        }
137137
138+         if  (opts .agentEnvironment () != null ) {
139+             opts .agentEnvironment ().forEach (agent ::addEnv );
140+         }
141+ 
138142        String  mavenConfigurationPath  = opts .mavenConfigurationPath ();
139143        if  (mavenConfigurationPath  != null ) {
140144            mountMavenConfigurationFile (server , mavenConfigurationPath );
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments