Skip to content

shcarrico/gitlab-ci

 
 

Repository files navigation

GitLab CI is an open-source continuous integration server

build status Code Climate Dependency Status Coverage Status

Screen

Requirements

GitLab CI officially supports (recent versions of) these Linux distributions:

  • Ubuntu Linux
  • Debian/GNU Linux

Additionally GitLab CI requires:

  • GitLab 6.3+ (to host the repositories you test)
  • ruby 1.9.3
  • MySQL or PostgreSQL

Hardware requirements:

  • 1GB of memory or more is recommended, 512MB works
  • 2 CPU cores or more are recommended, 1 CPU core works
  • A little disk space, 100MB or less

Features

  • Single Sign On: use the same login and password as on your GitLab instance
  • Quick project setup: add your project in a single click, all setup automatic via the GitLab API
  • Elegant and flexible: build scripts are written in bash, test projects in any programming language
  • Merge request integration: see the status of the feature branch build within the Merge Request
  • Distributed by default: GitLab CI and build runners can run on separate machines providing more stability
  • Realtime logging: the current build log scrolls and updates every few seconds

Roadmap

The following features are not yet in GitLab CI but merge requests are very welcome:

Runners

To perform the actual build you need a CI runner (also see the Architecture section below):

Architecture

GitLab CI is a web application with an API that stores its state in a databse. It manages projects/builds and provides a nice user interface. It uses the GitLab application API to authenticate users.

GitLab CI Runner is a pure ruby application which processes builds. It can be deployed separately and works with GitLab CI through an API.

In order to run tests you need at least 1 GitLab CI instance and 1 GitLab CI Runner. However, for running several builds at the same time you may want to setup more than one GitLab CI Runner.

Possible Cases:

  • 1 GitLab CI and N GitLab CI Runner instances on same machine
  • 1 GitLab CI and N GitLab CI Runner instances on different machines
  • 1 GitLab CI and N GitLab CI Runner instances on local machines

screen

For more information see: Announcing GitLab CI 3.0 and Integrating GitLab CI With GitLab to Enable Distributed Builds

Installation

How to add a new project to GitLab CI

  1. Log in the GitLab CI web interface
  2. Press the 'Sync now' button
  3. Select your project with the 'Add' button
  4. Go to the settings page of the project and add a build script (example given below)
  5. A new build should become visible on the project page of GitLab CI
  6. If the build fails then adjust the build script and press the 'Retry' button on the build page
  7. If the build is green you are done, all new commits will be tested and you see the status of merge requests builds within GitLab

Build script

For your information, the runner runs the line below before it runs the commands in your build script:

cd /gitlab-ci-runner/tmp/builds && git clone git@gitlab_server_fqdn:group/project.git project-1 && cd project-1 && git checkout master

Build script example:

bundle install
bundle exec rake db:create RAILS_ENV=test
bundle exec rake db:migrate RAILS_ENV=test
script/run_all_tests

The build command is run from GitlabCi::Build#command and contains the following environmental variables:

CI_SERVER, CI_SERVER_NAME, CI_SERVER_VERSION, CI_SERVER_REVISION
CI_BUILD_REF, CI_BUILD_BEFORE_SHA, CI_BUILD_REF_NAME (branch), CI_BUILD_ID

Documentation

All documentation can be found on doc.gitlab.com/ci/.

Getting help

Please see Getting help for GitLab on our website for the many options to get help.

About

Continuous integration server for gitlabhq | Coordinator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 78.9%
  • CSS 14.1%
  • Shell 5.4%
  • CoffeeScript 1.6%