Skip to content

Getting Started

Razorops CI/CD system helps automate the execution of pipeline on commits to a Git repository. This document will briefly explain the process of activating and configuring a CI/CD pipeline.

Signing up to Razorops

First of all, you need an account. You can choose one of the following methods to create an account -

Signing up with either of the Git service providers means you connect your Razorops account to your account on that service provider. With a connected account, you can easily grant Razorops access to any of your repositories on that account.

After signing up, you can connect your Razorops account to all of the supported service providers. For example, you can add docker registries (Dockerhub, Quay, GCR, ECR) or Slack account to get notifications.

Create Pipeline

Navigate to Pipelines tab in Razorops dashboard, and click on green + button. You'll see a list of repositories which can be activated with a simple toggle. When you activate your repository, we will automatically add webhooks to your version control system (e.g. GitHub).

Webhooks are used to trigger pipeline executions. When you push code to your repository, or open a pull request, or create a tag, your version control system will automatically send a webhook to the Razorops platform, which will, in turn, trigger a pipeline execution (workflow).

Configuration

To configure your pipeline, you should place a .razorops.yaml file in the root of your repository. The .razorops.yaml file what's used to define your pipeline steps. Here's an example pipeline configuration:

tasks:
  rspec:
    runner: razorci/ruby:3.3
    steps:
    - checkout
    - run: bundle exec rspec

And here's an advance pipeline configuration with multiple parallel steps:

tasks:
  build-image:
    steps:
    - checkout
    - docker/build:
        image: razorci/ruby:3.3
        tags: ["${CI_COMMIT_SHA}", "latest"]

  unit-test:
    runner:
      containers:
      - image: razorci/ruby:3.3
        environment:
        - DB_URL=postgres://root:secret@localhost/test
        - RAILS_ENV=test
      - image: mysql:5.6
        environment:
        - MYSQL_ROOT_PASSWORD=secret
        - MYSQL_DATABASE=test
        - MYSQL_ROOT_HOST=%
    steps:
    - checkout
    - run: bundle exec rspec

  deploy-staging:
    depends: [build-image, unit-test]
    steps:
    - run: kubectl set image deployment.v1.apps/api main=gcr.io/razorops/demo:$CI_COMMIT_SHA
    when: branch == 'staging'

The above pipeline will create a container image, run unit-tests and optionally push/deploy to a Kubernetes cluster.

Trigger Pipeline

To trigger your first workflow, you can push code to your repository, open a pull request, or push a tag. Any of these events triggers a webhook from your version control system and executes your pipeline.

You can view your pipeline execution in real-time in the dashboard.