Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detailed Documentation #24

Closed
loongmxbt opened this issue Nov 24, 2016 · 11 comments
Closed

Detailed Documentation #24

loongmxbt opened this issue Nov 24, 2016 · 11 comments
Labels

Comments

@loongmxbt
Copy link

loongmxbt commented Nov 24, 2016

Gatling is facinating! But following the docs will come up to some problems:

  1. Server Prerequisites
    git version must greater than 2.0
    Install Node (using nvm)
    Install Brunch gloabally, npm install -g brunch

  2. Necessary Config Files
    ./rel/config.exs
    config/prod.secret.exs
    domains
    deploy.exs -> deploy build static assets
    upgrade.exs -> upgrade build static assets

  3. How to setup SSL
    Using Lets Encrypt

  4. Trouble shooting

@loongmxbt
Copy link
Author

When I follow the deploy.exs do something similar in upgrade.exs, something goes wrong.

defmodule Starsoul.UpgradeCallbacks do
  import Gatling.Bash

  def after_mix_digest(env) do
    bash("npm", ~w[install], cd: env.build_dir)
    bash("brunch", ~w[build --production], cd: env.build_dir)
    bash("mix", ~w[phoenix.digest -o public/static], cd: env.build_dir)
    env
  end

end
remote: $ mix phoenix.digest (/root/starsoul)
remote: Check your digested files at "priv/static"
remote: $ npm install (/root/starsoul)
remote: ** (ErlangError) erlang error: :enoent
remote:     (elixir) lib/system.ex:552: System.cmd("npm", ["install"], [stderr_to_stdout: true, into: %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}, cd: "/root/starsoul"])

@mrmicahcooper
Copy link
Collaborator

There are all great points @loongmxbt.

If you're feeling up to it, perhaps you could make a pull request for the documentation you feel it's lacking?

Regarding item #4, Ideally, I'd like to support this out of the box and make this the default if you're running a Phoenix app. I think that would be awesome!

@loongmxbt
Copy link
Author

Sure, I would very like to write some wiki for gatling!

@dennisreimann
Copy link
Contributor

I'm currently also trying to improve the docs while making Gatling work for me :)

Install Brunch gloabally, npm install -g brunch

You don't need to install modules globally as long as you run the commands via the npm wrapper: See this for my proposed change to the README: cc4006b#diff-04c6e90faac2675aa89e2176d2eec7d8R284

@dennisreimann
Copy link
Contributor

How to setup SSL. Using Lets Encrypt

As this can get pretty special, this should be done via a custom nginx.conf as proposed in #10 – nevertheless it could need some hints in the docs or example config. I'd be willing to help with this :)

@jrissler
Copy link
Contributor

@dennisreimann I like the change in your compare

@dennisreimann
Copy link
Contributor

I finally found the time to do a detailed writeup of the steps involved for my first deployment using Gatling: https://dennisreimann.de/articles/phoenix-deployment-gatling-ubuntu-digital-ocean.html

@loongmxbt
Copy link
Author

loongmxbt commented Jan 3, 2017

@dennisreimann Great guide, helps a lot! Just some minor suggestions.

  1. explicitly tell include {:distillery, "~> 1.0"} in mix.exs as a compile-time dependency.
  2. Some common problem trouble shooting, like if distillery raises error One or more direct or transitive dependencies are missing from :applications or :included_applications, they will not be included in the release:, add those dependencies into applications.

e.g. In order to use :ex_admin with distillery, I have to add :ex_admin, :exactor, :hound to applications.
bitwalker/distillery#55

@loongmxbt
Copy link
Author

loongmxbt commented Jan 9, 2017

Here is a zh-cn translated guide. http://www.jianshu.com/p/0c2741910fe1

@dennisreimann
Copy link
Contributor

Most of this is covered with the recent docs changes – I'll try to add another guide about customizing the nginx setup as this question also came up in #5.

@dennisreimann
Copy link
Contributor

I have written the aforementioned guide and added it to the Guides and Resources section in the README.

As the mentioned points are covered by now I am closing this one. Feel free to open another issue requesting more docs if something is unclear or missing! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants