@@ -72,6 +72,12 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
7272 // targets to pass to prometheus
7373 let mut targets = Vec :: new ( ) ;
7474
75+ let mut service_common_envs = IndexMap :: new ( ) ;
76+ for ( key, val) in cb_config. env {
77+ let ( key, val) = get_env_val ( key. as_str ( ) , val. as_str ( ) ) ;
78+ service_common_envs. insert ( key, val) ;
79+ }
80+
7581 // address for signer API communication
7682 let signer_port = 20000 ;
7783 let signer_server =
@@ -112,6 +118,7 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
112118 get_env_interp ( MODULE_JWT_ENV , & jwt_name) ,
113119 get_env_val ( SIGNER_URL_ENV , & signer_server) ,
114120 ] ) ;
121+ module_envs. extend ( service_common_envs. clone ( ) ) ;
115122
116123 // Pass on the env variables
117124 if let Some ( envs) = module. env {
@@ -198,6 +205,7 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
198205 get_env_val ( CONFIG_ENV , CONFIG_DEFAULT ) ,
199206 get_env_uval ( BUILDER_PORT_ENV , builder_events_port) ,
200207 ] ) ;
208+ module_envs. extend ( service_common_envs. clone ( ) ) ;
201209
202210 if let Some ( ( key, val) ) = chain_spec_env. clone ( ) {
203211 module_envs. insert ( key, val) ;
@@ -247,6 +255,7 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
247255 // setup pbs service
248256
249257 let mut pbs_envs = IndexMap :: from ( [ get_env_val ( CONFIG_ENV , CONFIG_DEFAULT ) ] ) ;
258+ pbs_envs. extend ( service_common_envs. clone ( ) ) ;
250259 let mut pbs_volumes = vec ! [ config_volume. clone( ) ] ;
251260
252261 // ports
@@ -336,6 +345,7 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
336345 get_env_same ( JWTS_ENV ) ,
337346 get_env_uval ( SIGNER_PORT_ENV , signer_port as u64 ) ,
338347 ] ) ;
348+ signer_envs. extend ( service_common_envs. clone ( ) ) ;
339349
340350 let mut ports = vec ! [ ] ;
341351
@@ -464,6 +474,7 @@ pub async fn handle_docker_init(config_path: PathBuf, output_dir: PathBuf) -> Re
464474 get_env_val ( DIRK_KEY_ENV , DIRK_KEY_DEFAULT ) ,
465475 get_env_val ( DIRK_DIR_SECRETS_ENV , DIRK_DIR_SECRETS_DEFAULT ) ,
466476 ] ) ;
477+ signer_envs. extend ( service_common_envs. clone ( ) ) ;
467478
468479 let mut ports = vec ! [ ] ;
469480
0 commit comments