Skip to content

Adding OTP release handling on riakhttpc application #39

Description

@edwardt

It will be nice to add OTP release handling, thought this is an application library. But the versioning and packaging as such avoid copying the beam files everywhere if someone wants to integrate in their projects.

Here is the reltool.config (Erlang R15+ only) that I tested to use and it seems to generate the release under lib with the dependencies lib which can be further packaged for integration. There are some sections that are not required (like all of those overlay, booting up etc) because it is a library instead of a full blown node, but guess it is just a start. Please improve upon if decided to make the project OTP release handling friendly.

reltool.config:

{sys, [
       {lib_dirs, []},
       {erts, [{mod_cond, derived}, {app_file, strip}]},
       {app_file, strip},
       {rel, "riakhttpc", "1",
        [
         kernel,
         stdlib,
         sasl, 
     ibrowse,
         riakhttpc
        ]},
       {rel, "start_clean", "",
        [
         kernel,
         stdlib
        ]},
       {boot_rel, "riakhttpc"},
       {profile, embedded},
       {incl_cond, derived},
       {mod_cond, derived},
       {excl_archive_filters, [".*"]}, %% Do not archive built libs
       {excl_sys_filters, ["^bin/.*", "^erts.*/bin/(dialyzer|typer)",
                           "^erts.*/(doc|info|include|lib|man|src)"]},
       {excl_app_filters, ["\.gitignore"]},
       {app, hipe, 
            [
             {incl_cond, exclude}            
       ]},   
       {app, webmachine, 
            [{mod_cond, app},
             {incl_cond, include},
             {lib_dir, "../deps/webmachine"}
        ]},

       {app, ibrowse, 
            [{mod_cond, app},
             {incl_cond, include},
             {lib_dir, "../deps/ibrowse"}
        ]},
       {app, mochiweb, 
            [{mod_cond, app},
             {incl_cond, include},
             {lib_dir, "../deps/mochiweb"}
        ]},

       {app, meck, 
            [{mod_cond, app},
             {incl_cond, include},
             {lib_dir, "../deps/meck"}
        ]},

       {app, protobuffs, 
            [{mod_cond, app},
             {incl_cond, include},
             {lib_dir, "../deps/protobuffs"}
        ]},

       {app, 'riakc', 
            [{mod_cond, app},
             {incl_cond, include},
             {lib_dir, "../deps/riakc"}
        ]},

       {app, 'riak_pb', 
            [{mod_cond, app},
             {incl_cond, include},
             {lib_dir, "../deps/riak_pb"}
        ]},

       {app, 'riakhttpc', 
    [{mod_cond, app}, 
     {incl_cond, include},
     {lib_dir, ".."}
       ]}
]}.






{target_dir, "riakhttpc"}.

{overlay, [
           {mkdir, "log/sasl"},
           {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"},
           {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},
           {copy, "files/riakhttpc", "bin/riakhttpc"},
           {copy, "files/riakhttpc.cmd", "bin/riakhttpc.cmd"},
           {copy, "files/start_erl.cmd", "bin/start_erl.cmd"},
           {copy, "files/install_upgrade.escript", "bin/install_upgrade.escript"},
           {copy, "files/sys.config", "releases/\{\{rel_vsn\}\}/sys.config"},
           {copy, "files/vm.args", "releases/\{\{rel_vsn\}\}/vm.args"}
          ]}.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions