Skip to content

Instantly share code, notes, and snippets.

@piisalie
Last active April 17, 2020 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piisalie/45ae53efe61d8808b68dace7d5a6d433 to your computer and use it in GitHub Desktop.
Save piisalie/45ae53efe61d8808b68dace7d5a6d433 to your computer and use it in GitHub Desktop.
Elixir Deployment #1

Elixir Deployment Office Hours #1

We'll be using Google Meet for this first get together. I'll be driving but questions and discussions are highly encouraged.

https://meet.google.com/dzp-zhbb-ejn

Objective: have a repeatable process to deploy a Phoenix app to Digital Ocean

Prerequisites

We'll be as beginner friendly as possible, a familiarity with the following would can help but is not required. We can also discuss as we go:

  • Elixir 1.9 releases - We'll mostly gloss over this as we could do an entire hangout on preparing an application for release.

  • Web Servers - general knowledge that web servers exist, how to ssh into one, what a port is, etc

  • GitHub Actions - Mostly just know what they are, you don't need to have used them.

Tools

Notes

                      ubuntu

[source] -> [release] -> [servers]

https://github.com/piisalie/aws_training_elixirconf_2019/tree/master/4_the_details/exercise/web_app

Steps

  1. have an application
  2. build a release https://hexdocs.pm/phoenix/deployment.html#compiling-your-application-assets a. package assets b. ensure environment variables are setup https://hexdocs.pm/mix/Mix.Tasks.Release.html#module-runtime-configuration
  3. build an application server (terraform plan, and terraform apply) https://www.terraform.io/docs/configuration/variables.html
  4. cloud-init (to configure the application server)
  5. put release on server (shell script)
  6. unpack release
  7. start release

repo: https://github.com/piisalie/elixir_deployment_fun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment