CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.
Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file
CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.
Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file
Example: git config --global user.name "Your Name"
Example: git init
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |
Another way to deploy Elixir apps UPDATE: This article now uses an all-Elixir deployment strategy, instead of the Nginx reverse proxy strategy it had originally. There are A LOT of different ways to deploy Elixir/Phoenix applications. I want to fill a gap in the current literature: how do you deploy a Phoenix web app to a single Linux server optimizing for cost effectiveness, control, and simplicity, while using modern Elixir tools like releases to achieve zero-downtime deploys without hot code upgrading? I’m going to walk through a deployment strategy that can take you start-to-finish with a full-featured Phoenix web app running on a free-forever Google Cloud Platform Compute Engine instance. This setup is completely free, and when you have more traffic the cost of scaling on raw GCP instances is a lot cheaper than on platform-as-a-service offerings (Heroku, Gigalixir, Render, Fly, etc). And, you’re in full control of the system so you don’t have to work around any fixed limitations. Scaling can be as simple
| 2.3.1 :001 > class SchemaMigration < ActiveRecord::Base; self.primary_key = :version; end | |
| => :version | |
| class SchemaMigration < ActiveRecord::Base; self.primary_key = :version; end | |
| 2.3.1 :002 > SchemaMigration.first | |
| SchemaMigration Load (2.1ms) SELECT "schema_migrations".* FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC LIMIT 1 | |
| => #<SchemaMigration version: "20160727113335"> |
This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.
For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai
| # Let's assume you're driving Capybara in both RSpec request specs & Cucumber, | |
| # for example you're using Cucumber as a design/documentation tool, and RSpec | |
| # for the more boring integration tests. | |
| # You don't want to duplicate your click-this-click-that helpers to e.g. | |
| # log_in(username, password). | |
| # You may also have model state setup code which can be shared/reused. | |
| # Where can it go? How can it be loaded? I've been using the following approach: | |
| # |