This repo is a companion to the article, Continuous Integration with Semaphore & Nanobox showing how to use Nanobox in your Semaphore workflow.
Nanobox is a "micro-platform" that builds and runs your app anywhere - your local machine, a CI server, or in production.
Semaphore is a continuous integration platform that allows you to thoroughly test code as it moves through your development/deployment workflow.
Create a Nanobox account (it's free), then Download & Install Nanobox.
# clone the code
git clone https://github.com/sanderson/phoenix-semaphore-example.git
# cd into the project directory
cd phoenix-semaphore-example
Nanobox provides a simple way to add DNS aliases for apps running locally, so you can easily access them from a browser.
nanobox dns add local phoenix.dev
Nanobox will spin up a virtualized local dev environment isolated from your host machine.
nanobox run
This will drop you into a console inside your Nanobox container.
To get everything in place, you just need to install dependencies and seed your database. From inside your Nanobox console, run:
# install dependencies
mix deps.get
# seed the database
mix ecto.create && mix ecto.migrate
# install Node.js dependencies
npm install
With dependencies in place and data seeded, run the app with the following command (in the Nanobox console):
mix phoenix.server
Now you can visit phoenix.dev:4000
from your browser.
Semaphore environments and tests are configured through their dashboard. If tests are successful, you can deploy to a Nanobox app.