build-service

command module
v0.0.0-...-88863c8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2017 License: MIT Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Build service

HTTP service responsible for providing information about available builds.

Interface

All responses will be in JSON

- GET    /builds                  - A list of all builds
- GET    /build/{name}            - A list of all versions of a service
- GET    /builds/{name}/{version} - The details of a specific build
- DELETE /builds/{name}/{version} - Delete the build
- POST   /builds                  - Create a new build

The expected JSON format is

	{
	  "Hostname": "localhost",
	  "Architecture": "amd64",
	  "GoVersion": "1.1.1",
	  "SourceUrl": "https://github.com/HailoOSS/build-service/commit/53d6db9a88494e948b64415f53e1bf9da7efcc4b",
	  "BinaryUrl": "http://s3.amazon.com/abcdefg",
	  "Version": "20130627091746",
	  "Language": "Go",
	  "Name": "com.HailoOSS.kernel.build-service",
	  "TimeStamp": 1372346773
	}

Inner workings

Broadly speaking this service will:

  • be able to answer queries about which binaries it has ever built
DB

We will store a record of every service built in RDS.

Each record will be an immutable record of a build that has completed, and will include:

  • timestamp (UNIX timestamp when built, UTC seconds since 1970)
  • builtOn (hostname that did the build)
  • environment (debug information about the build environment, including Go version, architecture etc.)
  • sourceurl (the Github URL that prompted the build, down to the level of the exact commit hash)
  • service (fully qualified service name, eg: com.HailoOSS.kernel.discovery)
  • version (actually a date, eg: 20130601114431)
  • type (enum of Java/Go)
  • binaryurl (the location of the go binary or jar)
Installation
go get github.com/HailoOSS/build-service

build-service should now be in your go/bin directory

The service requires a MYSQL compatible DB (Amazon RDS works)

Running

Set the following environmet variables

BUILD_SERVICE_SQL_SERVER=db_hostname
BUILD_SERVICE_SQL_PORT=db_port
BUILD_SERVICE_SQL_USERNAME=db_username
BUILD_SERVICE_SQL_PASSWORD=db_password
BUILD_SERVICE_SQL_DATABASE=db_database_name

Run the following command to set up the tables

build-service -createtables

Run the service

build-service -port 1234 (-port is optional, the default is 3000)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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