Skip to content

robkinyon/ruby-packager

Repository files navigation

Packager

Gem Version Gem Downloads Yard Docs

Build Status Code Climate Code Coverage Inline docs

TL;DR

Create the following file:

package "foo" do
  version "0.0.1"
  type "deb"
  
  file {
    source "/some/place/in/filesystem"
    dest "/some/place/to/put/it"
  }

  files {
    source "/some/bunch/of/files/*"
    dest "/some/other/place"
  }
end

Invoke the associated packager script as follows:

$ packager execute <filename>

You now have foo-0.0.1.x86_64.deb with several files in it wherever you invoked packager.

Command-line options

You can pass in the following options to the packager:

--dryrun

This is a boolean that, if set, will do everything up to, but not including, invoking fpm.

--var pkg_name:foo pkg_version:0.0.1

This will set helpers that can be used within the DSL. The example will set the helper pkg_name to "foo" and the helper pkg_version to "0.0.1".

Due to how Thor works, you must pass multiple variables at the same time. As shown above, Thor requires keys and values to be joined by a colon (":").

Consider providing helpers for the following:

  • Package version
  • A root directory (so that your source files can be relative to something)
  • Package type (you may want to build a deb vs. an rpm at different times)

DSL

  • package
    • name String
    • type String
    • version VersionString
    • file / files
      • source String
      • dest String
    • link / links
      • source String
      • dest String
      • link Boolean
    • requires Array[String]
    • provides Array[String]
    • before_install Array[String]

Link

If link is true in your file, then a symbolic link will be created instead of a file being copied.

About

A DSL to create packages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages