Coder Social home page Coder Social logo

gitci314's Introduction

Virtua SA logo Gitci314 - Gitlab CI for Raspberry Pi 3B+

Run Gitlab and Gitlab CI on a Raspberry Pi 3 Model B+ with Docker !

This project is proudly offered to you by Virtua SA.

Install

  1. Get a Raspberry Pi 3 Model B+ (but it should works with RPi 2B (64b) and 3B too)
  2. Flash a Raspbian image on it
  3. sudo raspi-config
    • Configure your WiFi, enable SSH, allow only 16MB of RAM for the GPU ...
  4. curl -sSL https://raw.githubusercontent.com/virtua-sa/gitci314/master/install | bash

It takes up to 30 minutes to run Gitlab for the first time. Also, first access to Gitlab may be very slow but it improves greatly after few requets. So it might be a good idea to take a good cup of chocolate/coffee/tea while reading what Virtua SA can do for you or looking for your next job opportunity during the process ;)

Warning: SSH port of your Raspberry Pi will be changed from 22 to 2022 to allow Git over SSH.

Recommendations

  • Because Gitlab consumes a lot of RAM, this setup uses a 6GiB swap file
    • In aim to increase the lifespan of your Raspberry Pi SD card, you should move this file to an USB drive with : SWAPFILE=/dev/sdaX ./install or after the installation with: ./install-swap 6 /dev/sdaX
  • If you have an intensive use of Gitlab CI runners or if you have security concerns regarding your data, you should move the Gitlab Multi Runner image to another Raspberry Pi
  • In aim to have more space for your Git projects, move the shared folders to an external USB drive (see docker-compose.yml file)
  • Of course, this setup MUST NOT be used for production purpose. It is mainly a proof of concept and should be used as is.

HowTo

Login to Gitlab for the first time

  • Simply open the URL http://<your_raspberrypi_ip> in your favorite browser then set a new password for root account

Register a new Gitlab Runner for CI

  1. Grab the registration token of your Gitlab here: http://<your_raspberrypi_ip>/admin/runners

  2. Run following command on your Raspberry Pi:

    docker-compose run runner register \
      --executor "docker" \
      --docker-image "resin/rpi-raspbian:stretch" \
      --url "http://gitlab/" \
      --description "Docker Runner" \
      --tag-list "docker,rpi" \
      --run-untagged \
      --locked="false"

    Notes: you can use default settings, but make sure to provide your registration token when asked. If you get a timeout error from Docker, rerun the command.

    Warning: if you run Gitlab and the gitlab-runner on the same Raspberry Pi, you may encounter issues with the docker executor, so you should use only the shell executor instead.

  3. Restart the runner: docker-compose restart runner

Fix permission problems when upgrading Gitlab

  • docker-compose gitlab run update-permissions

Licence

This project is published under the terms of the Apache 2.0 licence.

This project uses ideas and some portions of code taken from gitlabhq/omnibus-gitlab.

gitci314's People

Contributors

golflima avatar

Stargazers

David avatar

Watchers

James Cloos avatar  avatar Rui Filipe Da Cunha Alves avatar Timothee Moulin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.