An opinionated view on installing software.
A collection of stand-alone bash scripts for provisioning a bare metal server.
To install from scratch, run
bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/bits-installer)This will install capbash into /usr/local/bin/bits. To install it somewhere else, for example:
bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/bits-installer) --path /tmpIf you don't trust this project, please don't pipe into bash, and instead download the file, inspect it and run it directly.
If you already have bits and want to upgrade to the altest, please run
bits update-selfOnce your bits installed (from above), you can install other bits by running
bits install <BIT_NAME>For example,
bits install elixirAll available configurations are managed through environment variables. If you wanted a different version of elixir, then you would run
ELIXIR_VERSION=1.4.1 bits install elixirIf you don't like the idea of installing the "bits" command line tool, then you can install the bits directly using bash and curl.
For example
bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/elixir.bits)To override defaults, set it as an environment variable
ELIXIR_VERSION=1.4.1 bash <(curl -s https://raw.githubusercontent.com/capbash/bits/master/elixir.bits)If you don't trust this project, please don't pipe into bash, and instead download the file, inspect it and run it directly.
Install Apache 2. Available configurations with defaults include
APACHE_VERSION=2.4.25
APACHE_UPDATERC=trueTo install, run
bits install apacheIf APACHE_UPDATERC is set to true, it will register itself with update-rc to automatically start when booting up the system.
Once installed, you can see the availbale options by running
sudo service apache
Certbox is a replacement to Let's Encyrpt script.
Installs . To install, run
bits install certbotInstalls Chrome Driver on your system. Available configurations with defaults include
CHROMEDRIVER_VERSION=2.21To install, run
bits install chromedriverCreates a Digital Ocean droplet that is ready for development. It will create the specified IMAGE of a specific SIZE.
This bit requires Dio installed locally, with a valid TOKEN to access the Digital Ocean API.
PREFIX=devbox
NAME=${PREFIX}${TS}
IMAGE=ubuntu-14-04-x64
SIZE=512mb
SLEEP=60
LOGFILE=/tmp/devbox_$NAME.logTo install, run
bits install devboxdioInstalls Doctl is a command line interface to Digital Ocean API
DOCTL_VERSION=1.6.1
PLATFORM=linux
DOCTL_BIN=/opt/doctl/1.6.1/binTo install, run
bits install doctlInstalls Elixir, which also needs Erlang, on your system. Available configurations with defaults include
# From erlang.bits
ERLANG_VERSION=19.2-1
ELIXIR_VERSION=1.4.1To install, run
bits install elixirInstalls Erlang on your system. Available configurations with defaults include
ERLANG_VERSION=19.2-1To install, run
bits install erlangInstall git.
GIT_VERSION=latestTo install, run
bits install gitClone a git project. Available configurations with defaults include
NAME=samplephp
URL=https://github.com/capbash/samplephp
INSTALL_DIR=/var/local/apps
USER_EMAIL=server@localhost
USER_NAME=server
GIT_REMOTE=origin
BRANCH=master
TAG=masterTo install, run
NAME=samplephp \
URL=https://github.com/capbash/samplephp \
TAG=v0.2 \
bits install gitcloneConfigure a remote git to the desired settings. Available configurations with defaults include
EMAIL=you@example.com
USERNAME="Ben Dover"
EDITOR=vi
PUSH=simpleTo install, run
EMAIL=yourname@example.com \
USERNAME=yourname \
bits install gitconfigConfigure your bash prompt to show important git branch information. Once configured your prompt will look similar to:
11:35 /src/bits (master)$To install, run
bits install gitpromptConfigure a ION Cube on your server.
Available configurations with defaults include
PHP_LIB_DATE=20131226
PHP_LIB_DIR=/usr/lib/php/${PHP_LIB_DATE}
PHP_VERSION=5.6
CONFD_DIR=/etc/php/${PHP_VERSION}/apache2/conf.dTo install, run
bits install ioncubeConfigure a JumpCloud daemon on your server.
To install, run
JUMPCLOUD_TOKEN=fill_me_in \
bits install jumpcloudConfigure your server to trust all hosts so that you can, for example, access services like GitHub and Bitbucket to download code.
To install, run
bits install knownhostsThis is obsolete, use certbox instead.
Installs Let's Encyrpt. To install, run
bits install letsencryptInstalls libsass and sassc (needed by node-sass and useful with Phoenix). A thank you to edouard-lopez for the fix.
To install, run
bits install libsassInstall Nginx. Available configurations with defaults include
NGINX_VERSION=1.8.0
NGINX_UPDATERC=true
If NGINX_UPDATERC is set to true, it will register itself with update-rc to automatically start when booting up the system.
Once installed, you can see the availbale options by running
sudo service nginx
A huge thank you to Jason Giedymin for the init.d script.
Installs MySQL. Available configurations with defaults include
MYSQL_VERSION=5.5.47
UBUNTU_VERSION=16.04Available MYSQL versions include
- 5.5.47
- 5.6.28
- 5.7.10
To install, run
bits install mysql
Installs PHP. Available configurations with defaults include
PHP_VERSION=5.6Available PHP versions include
- 5.6
To install, run
bits install php
Installs Pip. Available configurations with defaults include
# From python.bits
PYTHON_VERSION=2.7.11To install, run
bits install pipInstalls Python. Available configurations with defaults include
PYTHON_VERSION=2.7.11To install, run
bits install pythonInstalls Erlang (using erlang.bits) and Elixir (using elixir.bits), Sass (using sass.bits), Libsass (through sass.bits), Ruby (through sass.bits), Postgres (using postgres.bits), Node JS (using nodejs.bits) and then installs Phoenix. Available configurations with defaults include
# From erlang.bits
ERLANG_VERSION=19.2-1
# From elixir.bits
ELIXIR_VERSION=1.4.1
# From gitconfig.bits
EMAIL=you@example.com
USERNAME="Ben Dover"
EDITOR=vi
PUSH=simple
# From postgres.bits
POSTGRES_VERSION=9.6
PGADMIN_VERSION=3
# From ruby.bits (through sass.bits)
RUBY_VERSION=2.2.3
PHOENIX_VERSION=1.2.1
NODE_VERSION=5.3.0To install, run
bits install phoenixYou must ensure that your remote machine has the proper access to the git server. This could be done, by scp'ing a trusted public/private key that is authorized by your git server.
For example,
scp $HOME/.ssh/id_rsa.pub <remote_server>:/root/.ssh/
scp $HOME/.ssh/id_rsa <remote_server>:/root/.ssh/Installs Erlang (using erlang.bits) and Elixir (using elixir.bits), and then Postgres (using postgres.bits), and Node JS (using nodejs.bits) and Phoenix (using phoenix.bits). Then it will download a phoenix umbrella app where the phoenix web app should be located at ./apps/webapp. If you want to configure your app differently, then just spin up a phoenix.bit and configure as you wish.
Available configurations with defaults include
# From erlang.bits
ERLANG_VERSION=19.2-1
# From elixir.bits
ELIXIR_VERSION=1.4.1
# From gitconfig.bits
EMAIL=you@example.com
USERNAME="Ben Dover"
EDITOR=vi
PUSH=simple
# From postgres.bits
POSTGRES_VERSION=9.6
PGADMIN_VERSION=3
# From phoenix.bits
PHOENIX_VERSION=1.2.1
NODE_VERSION=5.3.0
SRC_DIR=/src
GIT_URL="git@bitbucket.org:capbash/samplephoenix.git"
GIT_BRANCH="master"
PROJECT_NAME="samplephoenix"To install, run
GIT_URL=git@github.com:capbash/samplephoenix.git \
PROJECT_NAME=samplephoenix \
bits install phoenixappCreates a Digital Ocean private image with everything to quickly spin up a phoenix ready development environment. It does not expose all available configurations (e.g. which version of ERLANG, or NODE_JS), so if you need something more customizable, then please consider wrapping this functionality directly.
This bit requires Dio installed locally, with a valid TOKEN to access the Digital Ocean API.
ERLANG_VERSION=19.1-3
ELIXIR_VERSION=1.4.1
PHOENIX_VERSION=1.2.1
POSTGRES_VERSION=9.6
NAME=elixir${ELIXIR_VERSION//[.|-]/}phoenix${PHOENIX_VERSION//[.|-]/}postgres${POSTGRES_VERSION//[.|-]/}
LOGFILE=/tmp/$NAME.log
SIZE=512mb
SLEEP=60To install, run
bits install phoenixdioInstalls Postgres. Available configurations with defaults include
POSTGRES_VERSION=9.6
PGADMIN_VERSION=3To install, run
bits install postgresInstalls Redis. Available configurations with defaults include
REDIS_VERSION=stableTo install, run
bits install redisInstalls Ruby. Available configurations with defaults include
RUBY_VERSION=2.2.3
RUBY_MODE=bin # or sourceTo install, run
bits install rubyInstalls SASS. Available configurations with defaults include
RUBY_VERSION=2.2.3To install, run
bits install sassCreates a Digital Ocean snapshot for re-use.
This bit requires Dio installed locally, with a valid TOKEN to access the Digital Ocean API.
ID=${ID}
NAME=${NAME}
DELETE=falseTo create an image called myapp against a droplet 1234 (could also be it's name, if it is
unique, then run
ID=1234 NAME=myapp bits install sassIf you have DELETE=true, then it will delete the snapshot when it's done.