The static binary repository manager
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
pkg
scripts
vendor
.gitignore
.goreleaser.yml
.travis.yml
CHANGELOG.md
Gopkg.lock
Gopkg.toml
LICENSE
Makefile
README.md
credits.go
main.go
main_test.go
version.go

README.md

Binrep

Build Status Go Report Card MIT License

Binrep is the static binary repository manager that uses Amazon S3 as file storage.

Overview

binrep provides a simple way to store and deploy static binary files such as Go binaries, tarballs, images and web assets(css/javascript). binrep just pushes static binary files into a S3 bucket with directory layouts like go get does, and pulls the binaries from the bucket.

The deployment of (private) tools written by Go takes a lot more works, especially in the environment that has many servers, than that of LL scripts in a single file such as shell script, Perl, Python, Ruby). Git is an informat approach to the deployment, but git is not for binary management. The next approach is a package manager such apt or yum, but it takes a lot of trouble to make packages. The other approach is just to use a HTTP file server including S3, but it needs uniform and accessible location of binary files and the version management. There, binrep resolves the problems of static binary management.

Features

The following features will be supported.

  • Amazon S3 as storage backend
  • directory layout <host>/<user>/<project> like go get and ghq do
  • version management like Capistrano
  • limitable network bandwidth

The following features will not be supported.

  • dependency management, that is supported by popular package managers such as Apt, Yum and Rubygems

Usage

Prepareation

Getting the latest version

$ curl -fsSL https://raw.githubusercontent.com/yuuki/binrep/master/scripts/install_latest_binary | bash /dev/stdin $GOOS $GOARCH | tar --exclude 'README.md' --exclude 'LICENSE' -xzf - -C /usr/local/bin/
  • GOOS: 'linux' or 'darwin'
  • GOARCH: '386' or 'amd64'

Set AWS environment

export AWS_REGION=us-east-1
export AWS_PROFILE=[your profile]

or

export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=[your access key]
export AWS_SECRET_ACCESS_KEY=[your secret key]

Set backend endpoint

export BINREP_BACKEND_ENDPOINT='s3://binrep-bucket'

or binrep --endpoint 's3://binrep-bucket' ...

Commands

list

$ binrep list github.com/fujiwara/stretcher/20171013135903/
github.com/fujiwara/stretcher/20171014110009/
github.com/motemen/ghq/20171013140424/
github.com/yuuki/droot/20171017152626/
github.com/yuuki/droot/20171018125535/
github.com/yuuki/droot/20171019204009/
...

show

$ binrep show github.com/yuuki/droot
NAME                    TIMESTAMP       BINNARY1
github.com/yuuki/droot  20171019204009  droot//2e6ccc3

push

$ binrep push github.com/yuuki/droot ./droot
--> Uploading [./droot] to s3://binrep-bucket/github.com/yuuki/droot/20171020152356
Uploaded to s3://binrep-bucket/github.com/yuuki/droot/20171020152356
--> Cleaning up the old releases
Cleaned up 20171017152626

push supports to push multiple binary files.

pull

$ binrep pull github.com/yuuki/droot /usr/local/bin
--> Downloading s3://binrep-bucket/github.com/yuuki/binrep/20171019204009 to /usr/local/bin

Directory layout on S3 bucket

s3://<bucket>/<host>/<user>/<project>/<timestamp>/
                                         -- <bin>
                                         -- meta.yml

The example below.

s3://binrep-repository/
|-- github.com/
    -- yuuki/
        -- droot/
            -- 20171013080011/
                -- droot
                -- meta.yml
            -- 20171014102929/
                -- droot
                -- meta.yml
    -- prometheus/
        -- prometheus/
            -- 20171012081234/
                -- meta.yml
                -- prometheus
                -- promtool
|-- ghe.internal/
    -- opsteam/
        -- tools
            -- 20171010071022/
                -- ec2_bootstrap
                -- ec2_build_ami
                -- meta.yml
                -- mysql_create_slave_snapshot

Terms

  • release: <host>/<user>/<project>/<timestamp>/

How to release

binrep uses the following tools for the artifact release.

make release

License

The MIT License.

Author

y_uuki