bobc

command module
v0.0.0-...-ede9753 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

README

bobc

A Remote Cache for Bob



bobc is a lightweight, open source implementation of the bob Cloud Platform - https://bob.build. It is implemented in Go, and it uses an AWS S3-compatible storage backend for storing build artifacts, along with a Postgres database for storing projects and artifact metadata.


Getting Started

To build and run bobc locally, you must have the following tools present on your system:

Bob is used to build the Go binary and the container image. Docker-compose is used to ramp up a local environment with a Postgres database, MinIO (S3-compatible object storage) and Adminer to aid in inspecting the database contents.

First of all, clone the repository and cd into it:

git clone https://github.com/benchkram/bobc
cd bobc

You also need to clone the bob repo, since the openapi-related generated files will need to be updated once the actual build is invoked.

bob clone

Building

To build the bobc container, run the following command:

bob build container

This command will install any build dependencies (Go, Docker, GolangCI-Lint), bootstrap the project, build the bobc binary and subsequently build the container.

Running

To set up the docker-compose environment and start the server run:

export API_KEY="example-api-key"
docker compose up -d

You should now see bobc running on port 8100.

Note: MinIO at localhost requires a host alias to be set up in order to work properly. You should add the following to your /etc/hosts file:

127.0.0.1       minio

Example: Creating a project and pushing artifacts to it

You must create a project to be able to sync artifacts to the server. To do so, open a new terminal session and use the following curl command:

curl -X POST http://localhost:8100/api/projects \
   -H "Content-Type: application/json" \
   -H "Authorization: Bearer $API_KEY" \
   -d '{"name": "bobc-example"}'

This will create a project named bobc-example.

Next, you should configure an authentication context for bob. We'll use the same API_TOKEN as bearer token:

export API_KEY="example-api-key"
bob auth init --token=$API_KEY

You can verify artifact sync is working by typing

cd example
bob build --insecure --push

We have to use the --insecure flag since bobc is running over HTTP by default locally. We also pass the --push flag to instruct bob to attempt to push artifacts to the artifact store. Bob will not push artifacts upstream by default.

For more information on how to use bob with bobc, please refer to the official documentation: https://bob.build/docs/remote-cache#pushing--pulling-artifacts

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
db
rnd
generated
Package generated provides primitives to interact with the openapi HTTP API.
Package generated provides primitives to interact with the openapi HTTP API.
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL