From 3465ba12fc4bd27b5dc4dda1c181a9ba3e0514c9 Mon Sep 17 00:00:00 2001 From: Maygician Date: Mon, 5 Oct 2020 20:38:23 +0700 Subject: [PATCH] daemon mode for server --- deploy/release.sh | 17 ++++++++++++++++- lp/lib/lp_web/controllers/git_controller.ex | 4 +++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/deploy/release.sh b/deploy/release.sh index b9e0c14..df8af2f 100644 --- a/deploy/release.sh +++ b/deploy/release.sh @@ -1,5 +1,6 @@ #!/bin/bash cd ../lp +sudo _build/prod/rel/lp/bin/lp stop # git pull origin pet mix deps.get --only prod MIX_ENV=prod mix compile @@ -7,5 +8,19 @@ npm install --prefix ./assets npm run deploy --prefix ./assets mix phx.digest # once you have something js related MIX_ENV=prod mix release -sudo _build/prod/rel/lp/bin/lp start +sudo _build/prod/rel/lp/bin/lp daemon + # note, that it is running in terminal + + + # start Starts the system + # start_iex Starts the system with IEx attached + # daemon Starts the system as a daemon + # daemon_iex Starts the system as a daemon with IEx attached + # eval "EXPR" Executes the given expression on a new, non-booted system + # rpc "EXPR" Executes the given expression remotely on the running system + # remote Connects to the running system via a remote shell + # restart Restarts the running system via a remote command + # stop Stops the running system via a remote command + # pid Prints the operating system PID of the running system via a remote command + # version Prints the release name and version to be booted \ No newline at end of file diff --git a/lp/lib/lp_web/controllers/git_controller.ex b/lp/lib/lp_web/controllers/git_controller.ex index 5a716e3..5485bd0 100644 --- a/lp/lib/lp_web/controllers/git_controller.ex +++ b/lp/lib/lp_web/controllers/git_controller.ex @@ -11,9 +11,11 @@ defmodule LpWeb.GitController do html(conn,"") end def oauth(conn, %{"code" => code}) do + #some persistance side effect + # persist(code) render(conn, "oauth2.html", code: code) # redirect(conn, "git.html") - html(conn,"") + # html(conn,"") end def github(conn, _params) do