Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • Dojo_Project_Nguyen/ui/dojocli
  • dojo_project/projects/ui/dojocli
  • tom.andrivet/dojocli
  • orestis.malaspin/dojocli
4 results
Select Git revision
Show changes
# Authentication to the Dojo
The authentication is done by the login command:
```bash
dojo session login
```
```console
Please wait while we login you into Dojo...
ℹ Login with Gitlab (https://gitedu.hesge.ch/):
✔ Login server started
⠇ Waiting for user to authorize the application in his web browser
```
At this time the cli opens a web browser to the Gitlab login page. Once you are logged in you will be asked to authorize the application to access your account. Click on the `Authorize` button.
![Authorize](../figures/GitlabLogin.png)
**Note:** If you want to use the cli in a headless environment you can use the `--cli` option. In this case you will be provided with a link to copy/paste in your browser.
Once, the authorization is done, the cli will retrieve the Gitlab token and will try to login to the Dojo backend. If everything is ok you will see the following output (the permissions section may differ depending on your account):
```console
Please wait while we login you into Dojo...
ℹ Login with Gitlab (https://gitedu.hesge.ch/):
✔ Login server started
✔ Login code received
✔ Login server stopped
✔ Gitlab tokens retrieved
ℹ Checking Gitlab token:
✔ Read access
✔ Write access
ℹ Login to Dojo backend:
✔ Logged in
ℹ Checking Dojo session:
✔ The session is valid
✔ Student permissions
✔ Teaching staff permissions
✔ Admin permissions
```
## Test if it is working
```bash
dojo session test
```
```console
ℹ Checking Dojo session:
✔ The session is valid
✔ Teaching staff permissions
✔ Student permissions
ℹ Checking Gitlab token:
✔ Read access
✔ Write access
```
Good news. You can use the Dojo!
# Assignment creation
The assignment is created by a member of the teaching staff and is the basis for students to perform their exercise.
1. To create an assignment
```bash
dojo assignment create --name <unique_name>
```
```console
Please wait while we verify and retrieve data...
ℹ Checking Dojo session:
✔ The session is valid
✔ Teaching staff permissions
ℹ Checking Gitlab token:
✔ Read access
✔ Write access
✔ Assignment name "unique_name" is available
Please wait while we are creating the assignment...
✔ Assignment successfully created
ℹ Name: unique_name
ℹ Web URL: https://gitedu.hesge.ch/dojo/assignment/unique_name
ℹ HTTP Repo: https://gitedu.hesge.ch/dojo/assignment/unique_name.git
ℹ SSH Repo: ssh://git@ssh.hesge.ch:10572/dojo/assignment/unique_name.git
```
where `<unique_name>` is the name of the assignment. By default only the creator of the exercise is added to
the assignment (which is just a git repository with some configuration files in it).
There are several other options that can be provided:
```bash
dojo assignment create --name <unique_name> --template <url>
```
where `<url>` is the url of the template repository one may want to use as a basis for the assignment-
```bash
dojo assignment create --name <unique_name> --members_username <usernames>
```
where `<usernames>` is a list of gitedu usernames that will be given the same permissions as the
user creating the assignment.
As usual one can show the help menu by typing
```bash
dojo assignment create --help
```
Or you may just enter (`--help` is implicit in most commands)
```bash
dojo assignment create
```
2. Clone the repository of the assignment that was just created:
```bash
git clone ssh://git@ssh.hesge.ch:10572/dojo/assignment/unique_name.git
```
3. Modify the `unique_name` assignment as you want (modify the Dockerfile, docker-compose.yml files, add a readme, source code, compilation tools, etc.). Commit and push our work (soon™ more details will be provided on how to create assignment).
4. Once the assignment is done and validated by the pipeline it must be published to be available to students:
```bash
dojo assignment publish unique_name
```
```console
? Are you sure you want to publish this assignment? Yes
Please wait while we verify and retrieve data...
ℹ Checking Dojo session:
✔ The session is valid
ℹ Checking assignment:
ℹ unique_name
✔ The assignment exists
✔ You are in the staff of this assignment
Please wait while we publish the assignment...
✔ Assignment unique_name successfully published
```
\ No newline at end of file
# Exercise creation
The exercise is an instance of a **published assignment** to be performed by students (or group of students).
1. Create an exercise
```bash
dojo exercise create --assignment unique_name
```
```console
Please wait while we verify and retrieve data...
ℹ Checking Dojo session:
✔ The session is valid
✔ Student permissions
ℹ Checking Gitlab token:
✔ Read access
✔ Write access
ℹ Checking assignment:
✔ Assignment "unique_name" exists
✔ Assignment "unique_name" is published
Please wait while we are creating the exercise...
✔ Exercise successfully created
ℹ Id: some-long-hash
ℹ Name: DojoEx - unique_name - your.name
ℹ Web URL: https://gitedu.hesge.ch/dojo/exercise/dojo-ex_unique_name_some-long-hash
ℹ HTTP Repo: https://gitedu.hesge.ch/dojo/exercise/dojo-ex_unique_name_some-long-hash.git
ℹ SSH Repo: ssh://git@ssh.hesge.ch:10572/dojo/exercise/dojo-ex_unique_name_some-long-hash.git
```
**Tips**: You cas use the --members_username or --members_id options to add other students of the group to the exercise.
2. Make changes and try solving the exercise.
3. The complete tests can be run with the following command.
```bash
dojo exercise run
```
```console
Please wait while we are checking and creating dependencies...
ℹ Checking exercise content:
✔ The exercise folder contains all the needed files
✔ The dojo_assignment.json file is valid
✔ The Docker deamon is running
Please wait while we are running the exercise...
✔ Docker Compose file run successfully
✔ Linked services logs acquired
✔ Containers stopped and removed
Please wait while we are checking the results...
✔ Results file found
✔ Results file is valid
✔ Results folder size is in bounds
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Results ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ ┃
┃ Global result : ✅ Success ┃
┃ ┃
┃ Execution exit code : 0 ┃
┃ ┃
┃ Tests passed : 3 ┃
┃ Tests failed : 1 ┃
┃ ┃
┃ Tests : ┃
┃ - ✅ ListeOrdonnee ┃
┃ - ✅ ListeVide ┃
┃ - ✅ ListeOrdreInverse ┃
┃ - ❌ ListeRandom ┃
┃ ┃
┃ Execution results folder : /home/username/DojoExecutions/dojo_execLogs_2023-08-21T21_33_38_684Z ┃
┃ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
```
This command runs the exercise in the current directory or in the path provided by the `--path` option.
4. Once confident enough in the solution, one can commit/push the solution.
This triggers the CI/CD pipeline on gitedu. In the CI/CD all immutable files are overwritten and
the docker-compose is executed (only logs from the current container are given) then other logs
are retrieved from the other images that may be used. The error code of the docker container is retrieved.
Wiki/figures/GitlabLogin.png

1.03 MiB

Wiki/figures/releases.png

522 KiB

# Documentation of the `dojo` CLI utility
# Documentation of `The Dojo CLI` utility
In this wiki you will find the documentation related to the `dojo` CLI.
## Dojo Project
The dojo platform is an online tool built to help practice programming by allowing users to propose assignments and perform them as exercises.
The two major concepts of the platform are the **assignments** (provided by teaching staff) and the **exercises** (performed by students).
More details here : [Dojo detailed presentation](0-Dojo-presentation)
## User documentation
* [Installation of the CLI](UserDocumentation/0-Installation)
* [Authentification](UserDocumentation/1-Authentification)
* [Assignment creation](UserDocumentation/2-Assignment-creation)
* [Exercice creation](UserDocumentation/3-Exercise-creation)
## Tutorials / Exemples
### Students / Everyone
* [How to perform an exercise](Tutorials/0-Exercise-perform)
### Teaching staff
* [How to create and publish an assignment](Tutorials/1-Assignment-creation)
## Development / Contribution
* [How to contribute]() - Available soon
* [How to setup your development environment](Development/1-How-to-setup-your-development-environment)
* [How to add a new command](Development/2-How-to-add-a-new-command)
\ No newline at end of file
All documentations are available on the [Dojo documentation website](https://www.hepiapp.ch/) : https://www.hepiapp.ch/.
\ No newline at end of file
sonar.projectKey=DojoCLI
sonar.qualitygate.wait=true