elosys:gitlab_ci-cd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
elosys:gitlab_ci-cd [2024/11/10 19:10] mohamed_addaelosys:gitlab_ci-cd [2024/11/10 19:37] (current) mohamed_adda
Line 76: Line 76:
 Download and run an automatic bash script that adds the necessary repositories to prepare for installing GitLab Runner on the system. Download and run an automatic bash script that adds the necessary repositories to prepare for installing GitLab Runner on the system.
  
-==== Step 2: Installing GitLab Runner ==== You can install GitLab Runner on your system with the following command.+==== Step 2: Installing GitLab Runner ==== 
 + 
 +You can install GitLab Runner on your system by following the official documentation: [GitLab Runner Installation Guide](https://docs.gitlab.com/runner/install/).
  
 ==== Step 3: Registering GitLab Runner ==== ==== Step 3: Registering GitLab Runner ====
  
-1.Log in to your GitLab account and go to the CI/CD tab.+1. '''Log in to GitLab'''   
 + 
 +2. '''Access Project Settings'''   
 +   - Go to your project in GitLab.   
 +   - In the left sidebar, select '''Settings''' > '''CI/CD'''
 + 
 +3. '''Find the Registration Token'''   
 +   - Scroll to the '''Runners''' section.   
 +   - Under '''Project Runners''', locate the '''Registration Token''' and copy it. 
 + 
 +4. '''Register the Runner on the Server'''   
 +   - On the server where you wish to register the runner, execute the following command: 
 +    
 +        sudo gitlab-runner register 
 +     
 +5. '''Enter Runner Details'''   
 +   - When prompted, provide: 
 +     - '''GitLab instance URL''': https://git.elosys.net 
 +     - '''Registration Token''': Paste the token copied from your project’s settings. 
 +     - '''Description''': Enter a descriptive name, such as elosys-project-runner. 
 +     - '''Tags''': Specify any tags for the runner (optional). 
 +     - '''Executor Type''': Choose the executor (e.g., docker, shell). 
 + 
 +6. '''Confirm Registration'''   
 +   - Return to '''Settings''' > '''CI/CD''' > '''Runners''' in your GitLab project.   
 +   - Verify that the runner is listed under '''Project Runners''' and is active. 
 +   -  
 +=== GitLab Runner Docker Executor Configuration === 
 + 
 +== File Location == 
 +To edit the configuration file, open it with nano: 
 + 
 +  sudo nano ~/.gitlab-runner/config.toml 
 +   
 + Configuration Details   Below is the configuration for the [[runners.docker]] section:
  
 +    [runners.docker]
 +    tls_verify = false
 +    image = "docker:stable"
 +    dns = ["8.8.8.8"]
 +    extra_hosts = ["register.elosys.net:195.154.29.195"]
 +    privileged = false
 +    disable_entrypoint_overwrite = false
 +    oom_kill_disable = false
 +    disable_cache = false
 +    volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
 +    shm_size = 0
 +    network_mode = "host"
  
  
  • elosys/gitlab_ci-cd.1731265845.txt.gz
  • Last modified: 2024/11/10 19:10
  • by mohamed_adda