Skip to content

Instantly share code, notes, and snippets.

@starbelly
Last active February 26, 2019 03:59
Show Gist options
  • Save starbelly/0504382d1c930f2fff92e153624d5275 to your computer and use it in GitHub Desktop.
Save starbelly/0504382d1c930f2fff92e153624d5275 to your computer and use it in GitHub Desktop.
rebar3 and rebar3_hex hex configurations for reference

rebar3 and rebar3_hex hex configurations for reference

Without rebar3_hex plugin

Bare minimum configuration for fetching private packages from an org on hexpm without rebar3_hex

rebar.config

{erl_opts, [debug_info]}.
{hex, [{repos, [#{name => <<"hexpm:myorg">>}]}]}.
{deps, [private_package_in_org]}.

hex.config

Currently there is not automagic way to create this config in rebar3 without rebar3_hex, so simply make the file ~/.config/rebar3/hex.config:

#{
  <<"hexpm:myorg">> =>
      #{
        repo_key => <<"key">>
      }
 }.

With rebar3_hex

rebar.config

{erl_opts, [debug_info]}.
{hex, [{repos, [#{name => <<"hexpm:myorg">>}]}]}.
{deps, [private_package_in_org]}.

You should use the plugin to generate these configurations, but are documented below as examples.

Configuration for publishing to any repo your user has or will have access to.

This configuration should be generated by the rebar3_hex plugin using the following command:

 rebar3 hex user auth 

Which should generate something similar to:

#{<<"hexpm">> =>
      #{read_key => <<"read_key">>,
        username => <<"starbelly">>,
        write_key =>
           {<<1,2,3>>,
            {<<3,2,1>>,
              <<7,8,9>>}}}}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment