Skip to content
A general purpose pallet (package) manager suitable for multi-language development.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.forklift G2-338 Support for single-line installers Apr 12, 2019
builtin G2-344 Fixed output of path command on import Apr 24, 2019
.gitattributes G2-152 git jack Jan 28, 2018
.gitignore
LICENSE
README.md G2-338 Support for single-line installers Apr 12, 2019
forklift
install G2-338 Find the forklift copy we just installed Apr 12, 2019
pom.xml G2-338 Released Forklift 0.0.7 Apr 12, 2019
test G2-338 Finished testing common config Apr 12, 2019

README.md

Forklift

A general purpose pallet (package) manager suitable for multi-language development.

Forklift, like npm or maven, can import and cache pallets from various warehouses. In addition to the forklift standard, the basic implementation is in bash, making it suitable for use with any development tooling or languages. One common use case is to abstract out common code from BASH scripts.

Usage

  • Install forklift: bash <(curl -L https://raw.githubusercontent.com/g2forge/forklift/master/install)
  • Run a command from a pallet: forklift run <warehouse> <pallet> <version> <command-with-arguments>
  • Upgrade forklift: forklift upgrade, will check for a new version of forklift itself and upgrade if appropriate
  • Uninstall forklift: forklift uninstall (will also clear out all cached and temporary data)

For more commands, please see the command line help by running forklift --help.

Example 1

To run BATS on tests.bats one might run:

forklift run com.github sstephenson/bats v0.4.0 bin/bats tests.bats

This will import the sstephenson/bats pallet from github if it has not already been imported. Then it will run the bin/bats script in that pallet with the aruments tests.bats. Note that version v0.4.0 is the latest release at the time of this writing.

Example 2

To get the OS distribution forklift is running on:

forklift run builtin common current osinfo --distro

This example shows the use of the builtin warehouse which references pallets in in the builtin directory. Note that the only version supported by the builtin warehouse is current denoting whatever version the currently running forklift install is. If you want to run a script from another version of forklift you can do so through the com.github warehouse, of course.

Example 3

To run bulldozer catalog on your project:

 forklift run org.maven com.g2forge.bulldozer:bd-build 0.0.2 catalog <PATH TO PROJECT>

This examples shows the use of the maven warehouse which allows one to reference JARs (and any other maven artifacts) as pallets. For more information about running commands from maven pallets (artifacts), please read the maven jack documentation.

Example 4

To install one or more OS packages:

forklift run builtin common current install <PACKAGES>

This examples shows off one of the internal functions of forklift: the ability to install operating system level packages across operating systems. This is particularly useful on Cygwin where this is no native command-line package installer.

You may be interested in the fl-clicommon pallet which takes advantage of this to install commonly needed command line tools.

Example 5

Forklift can be used to create self-installing pallets (GitHub repositories or Maven JARs for example). The below code will install forklift and then use it to run any forklift command.

bash <(curl -L https://raw.githubusercontent.com/g2forge/forklift/master/install) <ANY FORKLIFT COMMAND>

You can replace <ANY FORKLIFT COMMAND> with import <warehouse> <pallet> <version>, and add a post-import script to your pallet. As an example, please see fl-clicommon and winpty. You may also want to read the documentation on how to add forklift scripts to your pallet for GitHub or Maven.

Pallet Specifications

Each pallet is identified by a combination of a warehouse, pallet and version specifiers. The warehouse specifier must be a reversed DNS name (e.g. com.g2forge) matching the server hosting the warehouse. The format of the pallet and version specifiers depend on the jack, but POSIX paths and semantic versions are common.

Currently supported warehouses:

  • com.github: the pallet specifier must be of the form <organization-or-user>/<repository> and the version specifier must be <branch-or-tag-or-commit>
  • GitHub enterprise: the warehouse specifier must name a running GitHub Enterprise server (as determined by querying the API) and the pallet and version identifiers the same as for com.github.
  • org.maven: the pallet specifier must be of the form <group>:<artifact>.
  • builtin: a special case of a warehouse specifier not being a reversed DNS name. The builtin warehouse is used to run scripts from within forklift itself, critically helpful for bootstraping forklift

Glossary

  • "forklift" A program for moving pallets of files around a network.
  • "pallet": A group of files "exported" from a "warehouse".
  • "export": A declaration that a specific "warehouse" is able to provide a "pallet" of files to a "customer".
  • "import": A request by a "customer" to "import" a "pallet" of files.
  • "customer": An "importer" of "pallets"
  • "warehouse": An "exporter" of "pallets"
  • "jack": A small program, a plugin to forklift, which is used to move "pallets" from a "warehouse" to a "customer"

Legal

Copyright Greg Gibeling 2018, licensed under the Apache 2.0 license.

Standard

Coming soon...

Contributing

Issues and pull requests are welcome on github.com/g2forge/forklift.

Release

  1. Tag the release: git tag -m <TAG> <TAG> where <TAG> is of the form "v0.0.1"
  2. Create a release on github using the new tag
  3. Update the pom.xml version.
  4. Create the new milestone
You can’t perform that action at this time.