Skip to content

Instantly share code, notes, and snippets.

@wmealing
Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmealing/ece2a08d3077cbe75d45 to your computer and use it in GitHub Desktop.
Save wmealing/ece2a08d3077cbe75d45 to your computer and use it in GitHub Desktop.
Using node_package with relx.
Add node_package to rebar.config
{deps, [
....
{node_package, ".*",
{git, "https://github.com/wmealing/node_package.git", {branch, "develop"}}}
]}.
Make a rootdir/pkgs.vars
package_name, "adjutant_core"}.
{package_install_name, "adjutant_core"}.
{package_install_user, "adjutant_core"}.
{package_install_group, "adjutant_admins"}.
{package_install_user_desc, "Adjutant user"}.
{package_shortdesc, "Core package for adjutant"}.
{package_desc, "Core package or adjutant"}.
{package_commands, {list, [[{name, "adjutant_core"}]]}}.
{bin_or_sbin, "bin"}.
{license_type, "Apache 2"}.
{copyright, "2014 or something"}.
{vendor_name, "example.com, Inc"}.
{vendor_url, "http://example.com"}.
{vendor_contact_name, "Something Package Maintainer"}.
{vendor_contact_email, "packaging@example.com"}.
{license_full_text,
"This file is provided to you under the Apache License,
<snip>
"under the License."}.
{solaris_pkgname, "LIGHTSANDCLOCKEWORKadjutant_core"}.
steal makefile entries from pkgex https://github.com/voluntas/pkgex/blob/develop/Makefile
Change the release target,
make it use $(REBAR) (REBAR=`which rebar`), i'm not putting a binary file in my repo, to that way lies madness.
rel: deps compile
@$(REBAR) compile
relx <-- this line was previously rebar generate.
$ git tag v0.0.3.
$ commit -a
commit modified makefile, commit all modifications to git.
$ make package
<sneeeeip>
-- from the tail end --
# @`which rebar` skip_deps=true generate overlay_vars=../../vars.config
relx
===> Starting relx build process ...
===> Resolving OTP Applications from directories:
/Users/wmealing/Source/adjutant_core/package/adjutant_core-0.0.3.10.gec1f372/deps
/usr/local/Cellar/erlang/17.1/lib/erlang/lib
/Users/wmealing/Source/adjutant_core/package/adjutant_core-0.0.3.10.gec1f372/rel
===> Resolving available OTP Releases from directories:
/Users/wmealing/Source/adjutant_core/package/adjutant_core-0.0.3.10.gec1f372/deps
/usr/local/Cellar/erlang/17.1/lib/erlang/lib
/Users/wmealing/Source/adjutant_core/package/adjutant_core-0.0.3.10.gec1f372/rel
===> Resolved adjutant_core-0.0.3
===> Including Erts from /usr/local/Cellar/erlang/17.1/lib/erlang
===> release successfully created!
mkdir -p packages
mkdir -p osxbuild
cd adjutant_core-0.0.3.10.gec1f372 && \
cp -R rel/adjutant_core \
../osxbuild/adjutant_core-0.0.3.10.gec1f372
cd osxbuild && \
tar -czf ../packages/adjutant_core-0.0.3.10.gec1f372-OSX-x86_64.tar.gz \
adjutant_core-0.0.3.10.gec1f372
cd packages && \
for tarfile in `ls *.gz`; do \
shasum -a 256 ${tarfile} > ${tarfile}.sha \
; done
And the tar.gz file (i expected a pkg or something for osx).
$ cd adjutant_core-0.0.3.12.g9b58e4d
$ ls
Makefile _rel config deps pkg.vars.config priv rebar.config rel relx.config tools.mk
^ this is not the release, it sthe stuff inside _rel/myproject that i kinda expected to be there.
Maybe i need to hack the files to grab _rel/myproject/ for the tar.gz file
My goal is to eventually use cuttlefish ( https://github.com/basho/cuttlefish ), however i -still- feel like there is a step missing that my .config files are not being generated from the schema file.. not sure why.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment