Skip to content

Latest commit

 

History

History
159 lines (97 loc) · 2.95 KB

introduction.mdx

File metadata and controls

159 lines (97 loc) · 2.95 KB
title description
Introduction
Welcome to OpenCI Documentation

Prerequisites

To self-host OpenCI, you need to meet the following prerequisites:

  • Mac with M1 chip or higher
  • macOS 14.0 or higher

Initial Setup

To self-host OpenCI, you need to install several tools.

Tart

Tart is a tool for managing macOS VMs.

brew install tart

Firebase CLI

OpenCI uses Firebase, so Firebase CLI installation is required.

curl -sL https://firebase.tools | bash

OpenCI Runner

OpenCI Runner is a CLI to run OpenCI. Dart is required for installation.

dart pub global activate openci_runner
brew install dart-sdk

Download Base Image

OpenCI uses macOS 15.0 as the base image. This process takes considerable time.

# Login to GitHub Container Registry
echo -n ${github_acceess_token} | \
tart login ghcr.io \
--username ${username} \
--password-stdin

# Pull base image
tart pull ghcr.io/open-ci-io/sequoia:0.0.2

Firebase Configuration

OpenCI uses Firebase for backend services. Therefore, Firebase configuration is necessary.

Create Firebase Project

Access the Firebase Console with any Google account and create a project.

Firestore Setup

Firestore is used for build job registration. Please access Firestore and complete the provisioning.

Firebase Functions Setup

OpenCI uses Firebase Functions. Firebase Functions requires Blaze plan (paid) registration. The cost is around a few dollars per month.

Deploy Firebase Functions

Clone the OpenCI CLI repository.

gh repo clone open-ci-io/openci

Then, navigate to the firebase_functions directory and run the following command to deploy Firebase Functions.

cd apps/firebase_functions/functions
firebase deploy --only functions

GitHub App Configuration

OpenCI uses GitHub App to fetch build jobs.

Create GitHub App

Access Create GitHub App and create a GitHub App.

Then, specify the gitHubAppFunction of Firebase Functions as the webhook URL for the GitHub App.

Secret Configuration

Register the secrets used in Firebase Functions.

APP_ID

firebase functions:config:set APP_ID

GITHUB_WEBHOOK_SECRET

firebase functions:config:set GITHUB_WEBHOOK_SECRET

PRIVATE_KEY

firebase functions:config:set PRIVATE_KEY

Create Firebase Service Account

Create a Firebase service account and place it as apps/openci_runner/firebase_service_account.json.

Now the self-hosting setup for OpenCI is complete. Great job!