Checkpoint
[pwan.org.git] / content / hints / elixir-on-centos7.rst
diff --git a/content/hints/elixir-on-centos7.rst b/content/hints/elixir-on-centos7.rst
new file mode 100644 (file)
index 0000000..5529622
--- /dev/null
@@ -0,0 +1,53 @@
+Elixir on Centos 7
+##################
+
+:date: 2017-10-08
+:tags: hints, elixir, centos
+:category: hints
+:author: Jude N
+
+I'm at the point with a Elixir/Phoneix side project that I'm thinking about deployment.
+
+The first big stumbling block was that development envioronment (Ubuntu 16.04) wasn't the same as my deployment environment (Centos 7).
+For Ubuntu, I could pull the latest Elixir packages from `Erlang Solutions`_, but they don't host Centos Elixir packages,
+and the version of Elixir on EPEL is `over 4 years old`_ - old enough that 'mix deps' on my project was erroring out.
+
+I found the posts below about installing Elixir on Centos 7 but, they involve cloning the Elixir repo and building it from source,
+but I don't want development tools like git and gcc on my production machines.
+
+- https://gist.github.com/binarytemple-clients/52bec05fc9bdba80d737
+- http://www.jeramysingleton.com/install-erlang-and-elixir-on-centos-7-minimal/
+- https://www.unixmen.com/install-erlang-elixir-centos-7/
+  
+I also found https://www.vultr.com/docs/how-to-install-the-phoenix-framework-on-centos-7 but it involves downloading a
+precompiled `mystery meat`_ bundle off Github.  However https://github.com/elixir-lang/elixir doesn't mention that these precompiled
+bundles are available or how the bundles were built.  The precompiled bundle is mentioned on `the elixir-lang.org install page`_, but still, that's too mysterious for me.
+
+Maybe one of those links will work for you, but `what I want`_ is a way to build a more recent version of the Elixir rpm than what was available in EPEL. That way I can recompile and package Elixir on a dev machine, and then only copy the rpm up to my production machine.
+
+It looks like Elixir is stuck in EPEL waiting for the Erlang 18 release to get promoted in EPEL, so maybe I can take the existing Elixir packaging source and build it against the latest Erlang packages from Erlang Solutions...
+
+I found the packaging source at https://src.fedoraproject.org/rpms/elixir and after poking around a bit I came up with Vagrantfile below. It seems to be working OK so far.  
+:
+
+.. raw:: html
+         
+    <script src="https://gist.github.com/jude/1ed06603135cb47c4bb59e52e8c96af0.js"></script>
+
+Lessons Learned
+---------------
+- `spectool`_ is my new favorite utility.
+- Make sure your Elixir development environment is as close as possible to your deployment environment.
+
+Next Steps
+----------
+- Convert the Vagrantfile into a Dockerfile or start using vagrant-lxc
+
+.. _Erlang Solutions: https://www.erlang-solutions.com/resources/download.html
+.. _over 4 years old: https://koji.fedoraproject.org/koji/buildinfo?buildID=552725
+.. _the elixir-lang.org install page: https://elixir-lang.org/install.html#precompiled-package
+.. _mystery meat: http://www.torontosun.com/2017/07/19/mystery-meat-crashes-onto-florida-familys-roof
+.. _spectool: http://pkgbuild.sourceforge.net/spectool.html
+.. _what I want: https://www.youtube.com/watch?v=gJLIiF15wjQ
+
+