Skip to content

Instantly share code, notes, and snippets.

View ziazek's full-sized avatar

Zek ziazek

View GitHub Profile
@ziazek
ziazek / readmore.js
Created January 9, 2015 08:25
readmore.js
/*!
* @preserve
*
* Readmore.js jQuery plugin
* Author: @jed_foster
* Project home: http://jedfoster.github.io/Readmore.js
* Licensed under the MIT license
*
* Debounce function from http://davidwalsh.name/javascript-debounce-function
*/
def application do
[...,
applications: [..., :edeliver]]
end
defp deps do
[
...
{:edeliver, "~> 1.4.2"},
{:distillery, "~> 1.4"}]
@ziazek
ziazek / config
Last active June 1, 2017 09:05
.deliver/config
APP="deploy_phoenix"
BUILD_HOST="188.166.182.170"
BUILD_USER="deploy"
BUILD_AT="/tmp/edeliver/$APP/builds"
RELEASE_DIR="/tmp/edeliver/$APP/builds/_build/prod/rel/$APP"
# prevent re-installing node modules; this defaults to "."
GIT_CLEAN_PATHS="_build rel priv/static"
@ziazek
ziazek / prod.exs
Last active June 1, 2017 08:30
config/prod.exs
# ...
config :deploy_phoenix, DeployPhoenix.Endpoint,
http: [port: 8888],
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/manifest.json"
# ...
config :phoenix, :serve_endpoints, true
# ...
@ziazek
ziazek / prod.secret.exs
Last active June 1, 2017 08:49
Example Production secrets file
use Mix.Config
config :deploy_phoenix, DeployPhoenix.Endpoint,
secret_key_base: "<<SECRET_GOES_HERE>>"
# Configure your database
config :deploy_phoenix, DeployPhoenix.Repo,
adapter: Ecto.Adapters.Postgres,
username: "deployphoenix",
password: "mypassword",
@ziazek
ziazek / deploy_phoenix
Created June 1, 2017 09:36
Nginx site config
upstream deploy_phoenix {
server 127.0.0.1:8888;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
[Unit]
Description=Phoenix server for DeployPhoenix app
After=network.target
[Service]
User=deploy
Group=deploy
Restart=on-failure
Environment=HOME=/home/deploy/deploy_phoenix
<div class="jumbotron">
<h2><%= gettext "Welcome to %{name}", name: "Phoenix!" %></h2>
<p class="lead">This is a test deployment.</p>
</div>
<!-- ... -->
def project do
[app: :deploy_phoenix,
version: "0.1.0",
# ...
]
end
# ...
Model.new(:deploy_phoenix_prod_backup, 'deploy_phoenix Production Backup') do
database PostgreSQL do |db|
db.name = "deployphoenix_prod"
db.username = "deployphoenix"
db.password = "mypassword"
db.host = "localhost"
db.port = 5432
# db.socket = "/tmp/pg.sock"
db.skip_tables = []
# db.only_tables = ["only", "these", "tables"]