-
Notifications
You must be signed in to change notification settings - Fork 0
How to
Considering you're using Git and Github Classroom to make the students create their repository, this short tutorial will help you put in place the use of LAWG for your practical work sessions.
In your Github Classroom repository, you have to :
- Add all executables of LAWG (to make it available for students working on one of the main operating systems).
- Add a minimal
.settings.ymlconfiguration file containing :groups: ["TPA1", "TPA2", "TPA3"] # the groups you manage, used for the identity file creation at first launch questions: ["1", "2", "3.1", "3.2", "4"] # all the questions to be answered in the worksheet
- Adapt the worksheet if necessary to indicate when to "fix" a question.
- Add an introduction to explain the script in the worksheet, how it works and some safety instructions:
- Do not close the script other than with the
exitcommand. - Do not modify the repository without having the script open (changes made outside the script will be deleted when it is launched).
- Do not close the script other than with the
To use LAWG in the context of practical work session, you need to have the following steps:
- Have a way to authenticate to Github.
- Clone your repository.
- Launch LAWG for the first time to create configuration files.
To authenticate to Github and be able to pull from or push to the remote repository. To do so, there are 2 ways: via a SSH key or a Personal Access Token (PAT).
Firstly, you have to generate the SSH key on your computer (more info here 🔗). To do so, you can run this command on Linux:
ssh-keygen -t ed25519 -C "your_email@example.com"Then you have to copy the content of your newly generated public key:
cat ~/.ssh/id_ed25519.pubThe last step is to add your SSH key to Github, go there.
For the title, enter something identifying your computer, and for the key, paste the previously copied public key.
Using PAT (more info here 🔗)
Using a PAT to authenticate means you have to generate it through Github and then use it as password when cloning your repository.
Go there and set the same values as the following image.
You can set the expiration to
No expiration dateso you can use it for other labs.
After the creation of the PAT, don't forget to copy it right now because you won't be able to do it afterwards!
Now that you have either your SSH key or your PAT created, get the URL of your repository by clicking on the Code button.
- If you're using SSH, get the SSH URL.
- If you're using a PAT, get the HTTPS URL.
-
Firstly, open a terminal, go to the folder where you want to store your repository.
$ cd <your folder> -
Clone the repository. If you're using a PAT like in the following example, you will be asked to enter your Github username and password. For the password, enter the PAT generated previously.
$ git clone https://github.com/USERNAME/REPO.git # or the ssh url Username: YOUR_USERNAME Password: YOUR_PERSONAL_ACCESS_TOKEN
-
To avoid having to specify the remote and branch for each push, enter this command:
$ git config --global push.autoSetupRemote true
You may have several executables of LAWG in the repository. Pick the one for your OS and launch it.
Don't worry, the startup may take a few tens of seconds.
You'll be asked to enter your first name, last name and group at first. Then your method of authentication and then your SSH key path or your PAT and your Github pseudo.
The SSH key path have to be an absolute path to the key, nor public or private, only the name of the key (e.g.
/home/.ssh/id_ed25519).
Once you see this, the tool is ready to use.
At the top, you can write commands. Once you type a character, a list of the available commands and parameters is displayed.
You won't be able to run an unknown command or with wrong parameters.
At the bottom, the last event registered by the system is shown.