File tree Expand file tree Collapse file tree
cwh-repo2docker/cwh_repo2docker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ def cwh_repo2docker_jupyterhub_config(
172172 config_file = None ,
173173 service_name = 'environments' ,
174174 custom_menu = False ,
175+ service_environments = {},
175176 debug = False ):
176177 # hub
177178 c .JupyterHub .spawner_class = Repo2DockerSpawner
@@ -199,18 +200,6 @@ def cwh_repo2docker_jupyterhub_config(
199200 "--debug"
200201 ])
201202
202- environ_names = [
203- 'CONTAINER_IMAGE' ,
204- 'REGISTRY_HOST' ,
205- 'REGISTRY_USER' ,
206- 'REGISTRY_PASSWORD'
207- ]
208-
209- environments = {}
210- for name in environ_names :
211- if name in os .environ :
212- environments [name ] = os .environ [name ]
213-
214203 c .JupyterHub .template_vars .update ({
215204 'cwh_repo2docker_service_name' : service_name
216205 })
@@ -221,6 +210,6 @@ def cwh_repo2docker_jupyterhub_config(
221210 "url" : "http://127.0.0.1:10101" ,
222211 "display" : not custom_menu ,
223212 "oauth_no_confirm" : True ,
224- "environment" : environments ,
213+ "environment" : service_environments ,
225214 "oauth_client_allowed_scopes" : ["inherit" ]
226215 }])
Original file line number Diff line number Diff line change @@ -181,11 +181,24 @@ def resources(config):
181181debug_log = os .environ .get ('DEBUG' , '0' ) in ['yes' , '1' ]
182182
183183## Configure cwh_repo2docker spawner and service
184+ cwh_repo2docker_environ_names = [
185+ 'CONTAINER_IMAGE' ,
186+ 'REGISTRY_HOST' ,
187+ 'REGISTRY_USER' ,
188+ 'REGISTRY_PASSWORD'
189+ ]
190+
191+ service_environments = {}
192+ for name in cwh_repo2docker_environ_names :
193+ if name in os .environ :
194+ service_environments [name ] = os .environ [name ]
195+
184196cwh_repo2docker_config_path = '/srv/jupyterhub/cwh_repo2docker_config.py'
185197cwh_repo2docker_jupyterhub_config (
186198 c ,
187199 config_file = cwh_repo2docker_config_path ,
188200 custom_menu = True ,
201+ service_environments = service_environments ,
189202 debug = debug_log )
190203load_subconfig (cwh_repo2docker_config_path )
191204
You can’t perform that action at this time.
0 commit comments