Skip to content

Commit 4f8ea65

Browse files
committed
look for JSON file in a directory called "config" #10541
1 parent 7da6094 commit 4f8ea65

File tree

2 files changed

+22
-7
lines changed
  • doc/sphinx-guides/source/container/running
  • modules/container-configbaker/scripts/bootstrap/demo

2 files changed

+22
-7
lines changed

doc/sphinx-guides/source/container/running/demo.rst

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ To stop the containers hit ``Ctrl-c`` (hold down the ``Ctrl`` key and then hit t
2929

3030
To start the containers, run ``docker compose up``.
3131

32+
.. _starting-over:
33+
3234
Deleting Data and Starting Over
3335
-------------------------------
3436

@@ -142,15 +144,25 @@ One you make this change it should be visible in the copyright in the bottom lef
142144
Root Collection Customization (Alias, Name, etc.)
143145
+++++++++++++++++++++++++++++++++++++++++++++++++
144146

145-
Before running ``docker compose up`` for the first time, you can customize the root collection by editing the ``init.sh`` script above.
147+
Before running ``docker compose up`` for the first time, you can customize the root collection by placing a JSON file in the right place.
148+
149+
First, in the "demo" directory you created (see :ref:`demo-persona`), create a subdirectory called "config":
150+
151+
``mkdir demo/config``
146152

147-
First, uncomment the section that say "Updating root collection". Note that it references the file ``/scripts/bootstrap/demo/dataverse-complete.json``.
153+
Next, download :download:`dataverse-complete.json <../../_static/api/dataverse-complete.json>` and put it in the "config" directory you just created. The contents of your "demo" directory should look something like this:
154+
155+
.. code-block:: bash
148156
149-
Next, download :download:`dataverse-complete.json <../../_static/api/dataverse-complete.json>` and put it in the "demo" directory you created (see :ref:`demo-persona`). That directory should how have two files: ``init.sh`` and ``dataverse-complete.json``.
157+
% find demo
158+
demo
159+
demo/config
160+
demo/config/dataverse-complete.json
161+
demo/init.sh
150162
151163
Edit ``dataverse-complete.json`` to have the values you want. You'll want to refer to :ref:`update-dataverse-api` in the API Guide to understand the format. In that documentation you can find optional parameters as well.
152164

153-
To test your JSON file, run ``docker compose up``. Again, this only works when you are running ``docker compose up`` for the first time.
165+
To test your JSON file, run ``docker compose up``. Again, this only works when you are running ``docker compose up`` for the first time. (You can always start over. See :ref:`starting-over`.)
154166

155167
Multiple Languages
156168
++++++++++++++++++

modules/container-configbaker/scripts/bootstrap/demo/init.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ curl -sS -X PUT -d FAKE "${DATAVERSE_URL}/api/admin/settings/:DoiProvider"
2222
API_TOKEN=$(grep apiToken "/tmp/setup-all.sh.out" | jq ".data.apiToken" | tr -d \")
2323
export API_TOKEN
2424

25-
#echo ""
26-
#echo "Updating root collection..."
27-
#curl -sS -X PUT -H "X-Dataverse-key:$API_TOKEN" "$DATAVERSE_URL/api/dataverses/:root" --upload-file /scripts/bootstrap/demo/dataverse-complete.json
25+
ROOT_COLLECTION_JSON=/scripts/bootstrap/demo/config/dataverse-complete.json
26+
if [ -f $ROOT_COLLECTION_JSON ]; then
27+
echo ""
28+
echo "Updating root collection based on $ROOT_COLLECTION_JSON..."
29+
curl -sS -X PUT -H "X-Dataverse-key:$API_TOKEN" "$DATAVERSE_URL/api/dataverses/:root" --upload-file $ROOT_COLLECTION_JSON
30+
fi
2831

2932
echo ""
3033
echo "Revoke the key that allows for creation of builtin users..."

0 commit comments

Comments
 (0)