elosys:gitlab_ci-cd

Differences

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

Link to this comparison view

Next revision
Previous revision
elosys:gitlab_ci-cd [2024/11/07 10:55] – created mohamed_addaelosys:gitlab_ci-cd [2024/11/10 19:37] (current) mohamed_adda
Line 13: Line 13:
   - Automated building and testing   - Automated building and testing
   - Quick detection of integration issues   - Quick detection of integration issues
 +
 +
 +
  
 ===== Continuous Delivery (CD) ===== ===== Continuous Delivery (CD) =====
Line 68: Line 71:
 Handling sensitive or resource-intensive tasks. Handling sensitive or resource-intensive tasks.
 Ensuring dedicated resources are available for critical pipelines. Ensuring dedicated resources are available for critical pipelines.
 +
 +=====  Gitlab Runner Installation Steps =====
 +====Step 1: Adding Repositories with Bash Script =====
 +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 by following the official documentation: [GitLab Runner Installation Guide](https://docs.gitlab.com/runner/install/).
 +
 +==== Step 3: Registering GitLab Runner ====
 +
 +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.1730976906.txt.gz
  • Last modified: 2024/11/07 10:55
  • by mohamed_adda