This is a redo of chatops_deployer using Elixir to solve the following problems with the Ruby implementation:
- Dependency on Ruby
- Not able to deploy as self contained executable
- The app is not fault tolerant - sometimes gets stuck
- Streaming of logs can be done better
Other goals:
- Better directory structure for cloned repos (check feasibility of git worktree)
- Ability to list currently deployed apps
- Ability to write a check to see if app is up
- Ability to deploy static sites
TODO
Clone the repo and run:
mix deps.get
iex -S mix phoenix.server
You can access Dockup UI at http://localhost:4000.
# Install latest elixir
brew install elixir
cd dockup
./scripts/setup
Once compilation runs fine, you can start dockup. If you are running this on OSX, unless you have docker CLI available in the development environment, you need to enable dry run mode in order to start Dockup. Run:
# Use this instead of iex -S mix phoenix.server
DOCKUP_DRY_RUN=true iex -S mix phoenix.server
It is recommended to use Vagrant for the following reasons:
- You can use real docker and do real deployments on OSX
- You can destroy containers and restart from a clean slate
A Vagrantfile
is checked in which will provision an ubuntu machine with
everything ready for testing the app. Here's how you can set it up:
$ vagrant up
$ vagrant ssh
$ cd /vagrant
$ ./scripts/setup
Refer apps/dockup/config/config.exs
to see the list of configurations
This API endpoint is used to deploy a dockerized app.
curl -XPOST -d '{"git_url":"https://github.com/code-mancers/project.git","branch":"master","callback_url":"fake_callback"}' -H "Content-Type: application/json" http://localhost:4000/api/deployments