-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
defmodule Mix.Tasks.Bootleg.Init do | ||
use Bootleg.Task | ||
require Mix.Generator | ||
alias Mix.Generator | ||
|
||
@shortdoc "Initializes a project for use with Bootleg" | ||
|
||
@moduledoc """ | ||
Initializes a project for use with Bootleg. | ||
""" | ||
|
||
def run(_args) do | ||
deploy_file_path = Path.join(["config", "deploy.exs"]) | ||
Generator.create_directory("config") | ||
Generator.create_file(deploy_file_path, deploy_file_text()) | ||
end | ||
|
||
Generator.embed_text(:deploy_file, """ | ||
use Bootleg.Config | ||
# Configure the following roles to match your environment. | ||
# `build` defines what remote server your distillery release should be built on. | ||
# `app` defines what remote servers your distillery release should be deployed and managed on. | ||
# | ||
# Some available options are: | ||
# - `user`: ssh username to use for SSH authentication to the role's hosts | ||
# - `password`: password to be used for SSH authentication | ||
# - `identity`: local path to an identity file that will be used for SSH authentication instead of a password | ||
# - `workspace`: remote file system path to be used for building and deploying this Elixir project | ||
role :build, "build.example.com", workspace: "/tmp/bootleg/build" | ||
role :app, ["app1.example.com", "app2.example.com"], workspace: "/var/app/example" | ||
# Phoenix has some extra build steps which can be defined as task after the compile step runs. | ||
# | ||
# Uncomment the following task definition if this is a Phoenix application. To learn more about | ||
# hooks and adding additional behavior to your deploy workflow, please refer to the bootleg | ||
# README which can be found at https://github.com/labzero/bootleg/blob/master/README.md | ||
# after_task :compile do | ||
# remote :build do | ||
# "[ -f package.json ] && npm install || true" | ||
# "[ -f brunch-config.js ] && [ -d node_modules ] && ./node_modules/brunch/bin/brunch b -p || true" | ||
# "[ -d deps/phoenix ] && mix phoenix.digest || true" | ||
# end | ||
# end | ||
""") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/_build | ||
/deps | ||
/releases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file is responsible for configuring your application | ||
# and its dependencies with the aid of the Mix.Config module. | ||
use Mix.Config | ||
|
||
# This configuration is loaded before any dependency and is restricted | ||
# to this project. If another project depends on this project, this | ||
# file won't be loaded nor affect the parent project. For this reason, | ||
# if you want to provide default values for your application for | ||
# 3rd-party users, it should be done in your "mix.exs" file. | ||
|
||
# You can configure for your application as: | ||
# | ||
# config :n00b, key: :value | ||
# | ||
# And access this configuration in your application as: | ||
# | ||
# Application.get_env(:n00b, :key) | ||
# | ||
# Or configure a 3rd-party app: | ||
# | ||
# config :logger, level: :info | ||
# | ||
|
||
# It is also possible to import configuration files, relative to this | ||
# directory. For example, you can emulate configuration per environment | ||
# by uncommenting the line below and defining dev.exs, test.exs and such. | ||
# Configuration from the imported file will override the ones defined | ||
# here (which is why it is important to import them last). | ||
# | ||
# import_config "#{Mix.env}.exs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule N00b do | ||
@moduledoc """ | ||
Documentation for N00b. | ||
""" | ||
|
||
@doc """ | ||
Hello world. | ||
## Examples | ||
iex> N00b.hello | ||
:world | ||
""" | ||
def hello do | ||
:world | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
defmodule N00b.Mixfile do | ||
use Mix.Project | ||
|
||
def project do | ||
[app: :n00b, | ||
version: "0.1.0", | ||
elixir: "~> 1.4", | ||
build_embedded: Mix.env == :prod, | ||
start_permanent: Mix.env == :prod, | ||
deps: deps()] | ||
end | ||
|
||
# Configuration for the OTP application | ||
# | ||
# Type "mix help compile.app" for more information | ||
def application do | ||
# Specify extra applications you'll use from Erlang/Elixir | ||
[extra_applications: [:logger]] | ||
end | ||
|
||
# Dependencies can be Hex packages: | ||
# | ||
# {:my_dep, "~> 0.3.0"} | ||
# | ||
# Or git/path repositories: | ||
# | ||
# {:my_dep, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"} | ||
# | ||
# Type "mix help deps" for more examples and options | ||
defp deps do | ||
[ | ||
{:distillery, "~> 1.4", runtime: false}, | ||
{:bootleg, ">= 0.0.0", path: System.get_env("BOOTLEG_PATH"), runtime: false} | ||
] | ||
end | ||
end |