Skip to content

Commit

Permalink
Fix dogma/credo
Browse files Browse the repository at this point in the history
  • Loading branch information
Hermanverschooten committed Jan 5, 2017
1 parent 2904543 commit 700cfee
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
3 changes: 2 additions & 1 deletion lib/distillery.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ defmodule ExrmDeb.Distillery do
[Distillery](https://github.com/bitwalker/distillery)'s plugin system.
"""
use Mix.Releases.Plugin
alias ExrmDeb.Config

def before_assembly(release, _options), do: release
def after_assembly(release = %Release{}, _options) do
info "Building Deb Package"
case ExrmDeb.Config.build_config(:distillery, release) do
case Config.build_config(:distillery, release) do
{:ok, config} ->
ExrmDeb.start_build(config)
release
Expand Down
14 changes: 8 additions & 6 deletions lib/exrm_deb/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ defmodule ExrmDeb.Config do
"""

defstruct name: nil, version: nil, licenses: nil, maintainers: nil,
external_dependencies: nil, maintainer_scripts: [], config_files: [],
homepage: nil, description: nil, vendor: nil,
arch: nil, owner: [user: "root", group: "root"]
external_dependencies: nil, maintainer_scripts: [],
config_files: [], homepage: nil, description: nil,
vendor: nil, arch: nil,
owner: [user: "root", group: "root"]

use Vex.Struct
alias ReleaseManager.Utils.Logger
alias ExrmDeb.Utils
alias Mix.Project
import Logger, only: [debug: 1, error: 1]

Expand All @@ -35,9 +37,9 @@ defmodule ExrmDeb.Config do
[
{:name, Atom.to_string(release.name)},
{:version, release.version},
{:description, Mix.Project.config[:description]},
{:arch, ExrmDeb.Utils.Config.detect_arch}
] ++ config_from_package(Mix.Project.config[:package])
{:description, Project.config[:description]},
{:arch, Utils.Config.detect_arch}
] ++ config_from_package(Project.config[:package])

base_config =
base_config
Expand Down
3 changes: 2 additions & 1 deletion lib/exrm_deb/control.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ defmodule ExrmDeb.Control do
debug "Marking config files"
config_files = Map.get(config, :config_files, [])
:ok =
Path.join([control_dir, "conffiles"])
[control_dir, "conffiles"]
|> Path.join()
|> File.write(Enum.join(config_files, "\n"))
end

Expand Down
7 changes: 4 additions & 3 deletions lib/exrm_deb/data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ defmodule ExrmDeb.Data do
This module houses the logic required to build the data payload portion of the
debian package.
"""
alias ReleaseManager.Utils.Logger
alias ExrmDeb.Utils.Compression
alias ReleaseManager.Utils.Logger
alias ExrmDeb.Utils.Compression
alias ExrmDeb.Generators.{Changelog, Upstart, Systemd}
alias Mix.Project
import Logger, only: [debug: 1]

def build(dir, config) do
Expand Down Expand Up @@ -53,7 +54,7 @@ defmodule ExrmDeb.Data do

defp copy_release(data_dir, config) do
dest = Path.join([data_dir, "opt", config.name])
src = Path.join([Mix.Project.build_path, "rel", config.name])
src = Path.join([Project.build_path, "rel", config.name])

debug("Copying #{src} into #{dest} directory")
{:ok, _} = File.cp_r(src, dest)
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"certifi": {:hex, :certifi, "0.4.0", "a7966efb868b179023618d29a407548f70c52466bf1849b9e8ebd0e34b7ea11f", [:rebar3], []},
"cf": {:hex, :cf, "0.2.1", "69d0b1349fd4d7d4dc55b7f407d29d7a840bf9a1ef5af529f1ebe0ce153fc2ab", [:rebar3], []},
"combine": {:hex, :combine, "0.9.2", "cd3c8721f378ebe032487d8a4fa2ced3181a456a3c21b16464da8c46904bb552", [:mix], []},
"credo": {:hex, :credo, "0.4.12", "f5e1973405ea25c6e64959fb0b6bf92950147a0278cc2a002a491b45f78f7b87", [:mix], [{:bunt, "~> 0.1.6", [hex: :bunt, optional: false]}]},
"distillery": {:hex, :distillery, "1.0.0", "a866a72bf2a3a5f078f5a249017ed951acda88a760d200512f91f585d74db1ec", [:mix], []},
"credo": {:hex, :credo, "0.5.3", "0c405b36e7651245a8ed63c09e2d52c2e2b89b6d02b1570c4d611e0fcbecf4a2", [:mix], [{:bunt, "~> 0.1.6", [hex: :bunt, optional: false]}]},
"dogma": {:hex, :dogma, "0.1.8", "1ee856ed64f3ad635a4b2127beea427ea1b9bc271b8731679a97938e1827730f", [:mix], [{:poison, ">= 1.0.0", [hex: :poison, optional: false]}]},
"earmark": {:hex, :earmark, "1.0.1", "2c2cd903bfdc3de3f189bd9a8d4569a075b88a8981ded9a0d95672f6e2b63141", [:mix], []},
"erlware_commons": {:hex, :erlware_commons, "0.21.0", "a04433071ad7d112edefc75ac77719dd3e6753e697ac09428fc83d7564b80b15", [:rebar3], [{:cf, "0.2.1", [hex: :cf, optional: false]}]},
Expand Down

0 comments on commit 700cfee

Please sign in to comment.