Skip to content

Instantly share code, notes, and snippets.

Created July 12, 2015 02:10
Show Gist options
  • Save mpahrens/88e8812a1d7b3dfc9a13 to your computer and use it in GitHub Desktop.
Save mpahrens/88e8812a1d7b3dfc9a13 to your computer and use it in GitHub Desktop.
Release steps for Blockytalky elxir
The TL;DR of the release is to make a compiled binary (that runs really fast) with erlang and elixir bundled, to just drop on a raspberry pi and run.
This has the following steps:
0) get the arm-friendly erlang (it is in the repo in a tarball)
1) Compile the fancy js and scss into plain js and css
2) Bundle the static assets into tarballs
3) Update version number or clean for rerelease
4) compile and make a release bundle and tarball
5) update the github
6) deploy on blockytalky (rpi)
In your dev environment, make sure you have the erlang.tar.gz uncompressed somewhere in your filesystem. Change the location of it in:
`blockytalky/rel/relx.config` from /vagrant/erlang and /vagrant/erlang/lib to wherever you put this erlang directory. this is the version of erlang and the version of erts that will be bundled. If we wanted to make a release build that was x86 friendly, we could do that at some point.
if you do not have brunch installed (which brunch) run:
`npm install -g brunch`
in the blockytalky directory, run:
brunch build --production
in the blockytalky directory, run:
MIX_ENV=prod mix phoenix.digest
if you are "rebuilding" a release, (you are not changing the version number), make sure to run:
`MIX_ENV=prod mix release.clean` It may fail the first time (bug in 0.18.4 of exrm) so run it again
else if you are making a new release with a new version. update the version number in blockytalky/mix.exs.
in the blockytalky directory, run:
MIX_ENV=prod mix release
if you want to see what is going on, run instead:
MIX_ENV=prod mix release --verbosity=verbose
This uses the exrm project to build. read the docs there for help:
note: cross-compiling (x86 to arm) the way we want it is only supported in v0.18.4 and onwards
commit this to develop.
Make a release branch if there is anything in master you do not want in develop (config changes, etc.) then commit to master with the tag v#.#.# matching the release number in mix.exs
if the rpi is autorunning from the git cloned directory. just pull the latest master
otherwise, if you have it running the binary from elseware or you are setting it up for the first time. Make sure that the start command of your boot script runs the script corresponding to:
(sudo) rel/blockytalky/bin/blockytalky start
and stop corresponds to:
(sudo) rel/blockytalky/bin/blockytalky stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment