Cyril Rohr edited this page Apr 21, 2017 · 9 revisions

Welcome!

Barebuild allows to interactively or non-interactively build or provision "stuff", using the SSH protocol to interact with the build server.

You can find the list of supported commands below.

compile

On-demand compilation of binaries for specific linux distributions.

compile RECIPE --version= --target= --prefix= --quiet= --cache=

Example: Compile ruby 2.3.1 for ubuntu 14.04, and make it available at /usr/local/bin/ruby and /usr/local/bin/gem:

ssh barebuild.com compile ruby \
    --version=2.3.1 \
    --target=ubuntu:14.04 | tar xzf - -C /usr/local

Example: Compile python 2.7.11 for debian 7, and make it available in /opt/python-2.7:

mkdir -p /opt/python-2.7
ssh barebuild.com compile python \
    --version=2.7.11 \
    --target=debian:7 \
    --prefix=/opt/python-2.7 | tar xzf - -C /opt/python-2.7

Supported target distributions:

el:6
el:7
ubuntu:12.04
ubuntu:14.04
ubuntu:16.04
debian:7
debian:8
sles:11
sles:12

el stands for Enterprise Linux, which includes CentOS, RHEL, Oracle, Amazon among others. sles stands for SuSE Linux Enterprise.

vendor

Get a tarball of any Ruby | Python | Go | PHP project with all the required dependencies (language runtime, libraries, etc.) vendored, as you would get by running Heroku buildpacks on top of that project.

vendor REPO --prefix --buildpack --target

Example: Get a precompiled aws-cli on your servers

ssh barebuild.com vendor https://github.com/aws/aws-cli \
  --prefix=/opt/aws \
  --buildpack='https://github.com/pkgr/heroku-buildpack-python#buildcurl' \
  --target=debian:7 | tar xzf - -C /opt/aws

/opt/aws/run bin/aws --help

Example: Install a nodejs script without the need to have any node-related dependencies installed on your system:

ssh barebuild.com vendor https://github.com/garbin/elasticsearch-reindex \
    --buildpack=https://github.com/heroku/heroku-buildpack-nodejs \
    --prefix=/opt/elasticsearch-reindex \
    --target=ubuntu:14.04 | tar xzf - -C /opt/elasticsearch-reindex
/opt/elasticsearch-reindex/run bin/elasticsearch-reindex.js --help

Example: Compile a Go program:

mkdir /opt/gogs
ssh barebuild.com vendor https://github.com/gogits/gogs \
    --buildpack=https://github.com/heroku/heroku-buildpack-go \
    --target=ubuntu:14.04 | tar xzf - -C /opt/gogs
/opt/gogs/bin/gogs --help

Note:

  • A run wrapper comes with the tarball. It is required to properly set up the env variables required for the packaged binaries to find themselves.

  • The prefix is optional for Ruby, Go, and NodeJS buildpacks, since the language runtime properly supports relative loading, or generates a single binary, and as such the resulting tarball can be extracted wherever you see fit.

  • Go projects can be compiled on any target distribution, and the resulting tarball will contain a binary that can be a) installed on any Linux distribution, b) run without the need for the run wrapper.

  • Ruby, Python and PHP projects require a specific buildpack since they require a language runtime that is dependent of the target distribution, and the default Heroku buildpack only handles ubuntu:14.04.

      Python: https://github.com/pkgr/heroku-buildpack-python#buildcurl
      Ruby: https://github.com/pkgr/heroku-buildpack-ruby#buildcurl
      PHP: https://github.com/pkgr/heroku-buildpack-php#buildcurl
    

http

Host anything on a short-lived HTTP server.

You must pipe a tar archive containing files on STDIN, and the files contained in that archive will be accessible at the URL returned in the output attribute.

tar cf - . |  http start
#> {"id":"01b018ba-d515-4a5b-82d1-7aaf57da5bb8","output":"http://xxx:33019"}

http stop ID

postgres

Start a short-lived postgres server.

postgres start
#> {"id":"e133ca6c-d8e5-449a-b83b-79de9b3b7ffe","output":"postgres://postgres:auncpOBvh2KwygNx@xxx:33020/postgres"}

postgres stop ID

redis

Start a short-lived redis server.

redis start
#> {"id":"53432f67-e267-4c35-8781-55c10e880443","output":"redis://xxx:33021"}

redis stop ID

Enjoy, and be nice!

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.