1.3 KiB
1.3 KiB
Tutorial uploader
This script uploads tutorials to IBM Quantum Learning.
Developing
To work on this script, you'll need to set up the saiba-api
project locally.
There are some extra steps you'll need to take to set up saiba-api
for
developing this script:
-
Follow the instructions in the README in the saiba-api repo. Don't forget the instructions to add the
PUBLIC_URL
entry to yourdocker-compose.yaml
. -
Login into the local CMS (http://0.0.0.0:8055/admin/) using
- email:
admin@example.com
- password:
password
- email:
-
Create a token for local testing.
- In the local CMS, go to "User directory" (in the leftmost navbar)
- Click "Create item"
- Create a new user with the "Content creator admin" role and generate a new static token. Copy the token to your clipboard. Then click the tick on the top-right of the page to save the user.
- To test the script in this repo, export the following environment
variables.
Consider using direnv to handle this.export LEARNING_API_URL=http://0.0.0.0:8055 export LEARNING_API_TOKEN=<copied-token>
-
With the local database running, run the following command to add the topics and categories that we expect to exist.
npm run tutorial:setup-testing