Java Exercises
Git configuration
Add global required configuration.
git config --global user.name <your gitlab login>
git config --global user.email <your gitlab email>
SSH key allows you to establish a secure connection between your docker container and GitLab.
Generate a SSH key in the docker command line (with a passphrase, please):
ssh-keygen -t rsa -b 2048 -C "<your gitlab email> gitlabciintroduction"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Created directory '/home/user/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa
Your public key has been saved in /home/user/.ssh/id_rsa.pub
The key fingerprint is:
SHA256: *******
Copy your public ssh key (cat /home/user/.ssh/id_rsa.pub
to read it) into your
GitLab profile SSH keys
Launch SSH agent to keep the SSH key addition alive:
echo "eval \"\$(ssh-agent -s)\"" >> /home/user/.bashrc
source /home/user/.bashrc
ssh-add
Enter passphrase for /home/user/.ssh/id_rsa:
Identity added: /home/user/.ssh/id_rsa (<your gitlab email> gitlabciintroduction)
At this point, you will only have to relaunch ssh-add
command if you exit and relaunch docker.
Branch creation
First, you will have to create a branch from the git repository on the INRIA GitLab as a branch of the main repository for the gitlabciintroduction project.
git clone git@gitlab.inria.fr:formations/integrationcontinue/gitlabciintroduction.git
Cloning into 'gitlabciintroduction'...
The authenticity of host 'gitlab.inria.fr (128.93.193.23)' can't be established.
ED25519 key fingerprint is SHA256:******.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitlab.inria.fr' (ED25519) to the list of known hosts.
remote: Enumerating objects: 693, done.
remote: Counting objects: 100% (693/693), done.
remote: Compressing objects: 100% (310/310), done.
remote: Total 693 (delta 325), reused 684 (delta 321), pack-reused 0
Receiving objects: 100% (693/693), 2.40 MiB | 1023.00 KiB/s, done.
Resolving deltas: 100% (325/325), done.
By convention for the exercise, we will ask you to create a branch named <your gitlab login>
to avoid duplicated branch name.
The branch name you choose will be annotated <your branch name>
in the exercise.
cd gitlabciintroduction
git checkout -b <your branch name>
Switched to a new branch '<your branch name>'
git status
On branch <your branch name>
nothing to commit, working tree clean
We can now force the branch creation in order to trigger the default continuous integration script.
git push --set-upstream origin <your branch name>
...
* [new branch] <your branch name> -> <your branch name>
Branch <your branch name> set up to track remote branch <your branch name> from origin.
Home | Java Home | << Java Previous - Docker setup | >> Java Next - Local test