Getting Started


Razorops's CI/CD system allows you to 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 a Razorops 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:
    image: ruby:2.6
    commands:
      - bundle exec rspec

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


























 






tasks:
  build-image:
    type: build
    image: gcr.io/razorops/demo
    tags: ["${CI_COMMIT_SHA}", "latest"]
  
  unit-test:
    image: gcr.io/razorops/demo:latest
    commands:
      - bundle exec rspec
    variables:
      - DB_URL=postgres://root:secret@localhost/test
      - RAILS_ENV=test
    services:
      - image: mysql:5.6
        environment:
          - MYSQL_ROOT_PASSWORD=secret
          - MYSQL_DATABASE=test
          - MYSQL_ROOT_HOST=%

  push-image:
    type: push
    image: gcr.io/razorops/demo
    tags: ["${CI_COMMIT_SHA}", "latest"]
    when: branch == 'staging'

  deploy-staging:
    image: bitnami/kubectl
    commands:
      - 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.