Skip to content

Commit

Permalink
Use bash env substitution for key export
Browse files Browse the repository at this point in the history
  • Loading branch information
nmearl committed Oct 19, 2023
1 parent 8076609 commit 89adeb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ jobs:
- name: Export variables for image
run: |
ls -lrt
echo -e "\nexport CDS_API_KEY=${{ secrets.CDS_API_KEY }}" >> postBuild
less postBuild
export CDS_API_KEY=${{ secrets.CDS_API_KEY }}
cat jupyter_server_config_extra.py | envsubst
less jupyter_server_config_extra.py
- name: Build and push the image to quay.io
uses: jupyterhub/repo2docker-action@master
Expand Down
7 changes: 5 additions & 2 deletions jupyter_server_config_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

NB_PATH = Path(hubbleds.__file__).parent / "HubbleDS.ipynb"
SERVICE_PREFIX = os.environ["JUPYTERHUB_SERVICE_PREFIX"]

CDS_API_KEY = "${CDS_API_KEY}"

c.ServerProxy.servers = {
"hubble": {
Expand All @@ -27,6 +27,9 @@
],
"absolute_url": False,
"launcher_entry": {"title": "Hubble Data Story"},
"timeout": 15
"timeout": 15,
"environment": {
"CDS_API_KEY": CDS_API_KEY
}
},
}

0 comments on commit 89adeb6

Please sign in to comment.