Size: 1854
Comment:
|
Size: 2062
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
See https://gitlab.control.lth.se/regler/<REPO>/-/settings/ci_cd, where <REPO> should be replaced with the repository name, for instructions about runners. | Currently there is one runner for projects in the regler group on gitlab, but it is running on Albins computer and might not be there forever. See https://gitlab.control.lth.se/regler/<REPO>/-/settings/ci_cd, where <REPO> should be replaced with the repository name, for instructions about setting up your own for a specific project. |
Line 19: | Line 21: |
The API token can be generated in a canvas profile, and this one is generated from an account that should have access to all courses run by Automatic Control `13596~t2TYuTRlaJnfvyTznfvhDOqq7B85o2wD2jU8NBCsixzLirB8nceTFIvUzbldIa1K`. It is available to all repositories in the regler group on gitlab under the name CANVAS_TOKEN. | The API token can be generated in a canvas profile, and this one is generated from an account that should have access to all courses run by Automatic Control `13596~t2TYuTRlaJnfvyTznfvhDOqq7B85o2wD2jU8NBCsixzLirB8nceTFIvUzbldIa1K`. It is available to all repositories in the regler group on gitlab as an environment variable under the name CANVAS_TOKEN. |
Gitlab to Canvas syncing
For a working example check out the FRTF10-repo where as soon as any changes in pdfs are pushed to the to_canvas folder they are uploaded to the from_git folder on the canvas page.
Gitlab CI
Gitlab CI is run through a file called .gitlab-ci.yml in the root folder of the repository. This file can setup the environment we need to run certain scripts, define how and what scripts should be run and define in what cases it should be run. An example file can be found here. It contains the CANVAS_COURSE_CODE variable which defines where the script should upload to.
Runners
Currently there is one runner for projects in the regler group on gitlab, but it is running on Albins computer and might not be there forever.
See https://gitlab.control.lth.se/regler/<REPO>/-/settings/ci_cd, where <REPO> should be replaced with the repository name, for instructions about setting up your own for a specific project.
Python script
The current script uploads all files from the to_canvas folder (with subfolders) and creates the corresponding folder structure on canvas in the from_git folder.
Currently the script will upload and replace files if they already exists, but it wont otherwise delete files if they are removed from the repo.
Canvas API Token
The API token can be generated in a canvas profile, and this one is generated from an account that should have access to all courses run by Automatic Control 13596~t2TYuTRlaJnfvyTznfvhDOqq7B85o2wD2jU8NBCsixzLirB8nceTFIvUzbldIa1K. It is available to all repositories in the regler group on gitlab as an environment variable under the name CANVAS_TOKEN.