Giter Club home page Giter Club logo

exrm_deb's Introduction

Elixir Release Manager DEB generator

Coverage Status Build Status Hex version Inline docs

Adds simple Debian Package (DEB) generation to the exrm package manager.

Functionality list

  1. Able to build debian packages:
    1. With changelog
    2. With control file
  2. Ability to add in pre/post install/remove scripts
  3. Validates configuration before completing the build
  4. Add ability for you to replace file templates with your own
  5. Automatically builds init scripts:
    1. Upstart
    2. Systemd
    3. SysV
  6. Handle functionality for Hot Upgrades
  7. Merge debian to-be-deployed files with your own structure

External dependencies

Before using exrm-deb, you'll need the following commands installed and in your path:

  • ar
  • uname

Configuration

Exrm-deb relies on the following data in the mix.exs file being set:

defmodule Testapp.Mixfile do
   use Mix.Project

   def project do
      [app: :testapp,
      version: "0.0.1",
      elixir: "~> 1.0",
+     description: "Create a deb for your elixir release with ease",
      build_embedded: Mix.env == :prod,
      start_permanent: Mix.env == :prod,
-     deps: deps]
+     deps: deps,
+     package: package]
   end

The package function must be set as per the hex guidelines, but with some extra lines:

def package do
   [
+     external_dependencies: [],
+     license_file: "LICENSE",
      files: [ "lib", "mix.exs", "README*", "LICENSE"],
      maintainers: ["John Hamelink <[email protected]>"],
      licenses: ["MIT"],
      vendor: "John Hamelink",
      links:  %{
        "GitHub" => "https://github.com/johnhamelink/testapp",
        "Docs" => "hexdocs.pm/testapp",
+       "Homepage" => "https://github.com/johnhamelink/testapp"
      }
   ]
end

A list of configuration options you can add to package/0:

  • licenses
    • Array of strings
    • Can be something like ["Copyright <date> <company_name>"] if you are building private packages.
  • maintainers
    • Array of Strings
    • Should be in the format name <email>
  • external_dependencies
    • Array of Strings
    • Should be in the format of package-name (operator version_number) where operator is either <<, <=, =, >=, or >> - read more about this here.
  • maintainer_scripts
    • A keyword list of Strings
    • The keyword should be one of: :pre_install, :post_install, :pre_uninstall, or :post_uninstall
    • The keyword should point to the path of a script you want to run at the moment in question.
  • vendor
    • String
    • The distribution vendor that's creating the debian package. I normally just put my name or company name.
  • owner
    • A keyword list of Strings
    • If set, requires both user and group keys to be set.
    • This is used when building the archive to set the correct user and group
    • Defaults to root for user & group.

Usage

Building Deb file

You can build a deb at the same time as building a release by adding the --deb option to release.

mix release --deb

This task first constructs the release using exrm, then generates a deb file for the release. The deb is built from scratch, retrieving default values such as the name, version, etc using the mix.exs file.

The _build/deb directory tree, along with the rest of the release can be removed with mix release.clean

Please visit exrm for additional information.

Customising deb config files

You can customise the debs that are being built by copying the template files used and modifying them:

mix release.deb.generate_templates

When you next run mix release --deb, your custom templates will be used instead of the defaults inside the plugin.

Installation

The package can be installed as:

  1. Add exrm_deb to your list of dependencies in mix.exs:

    def deps do [{:exrm_deb, "~> 0.0.1"}] end

  2. Ensure exrm_deb is started before your application:

    def application do [applications: [:exrm_deb]] end

exrm_deb's People

Contributors

0chroma avatar johnhamelink avatar michalmuskala avatar tverlaan avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.