An open API service indexing awesome lists of open source software.

https://github.com/mazyod/homebrew-truck

Homebrew formula for Truck
https://github.com/mazyod/homebrew-truck

automation aws binaries command-line dependency-manager git homebrew python version-control

Last synced: 8 days ago
JSON representation

Homebrew formula for Truck

Awesome Lists containing this project

README

          

# Truck :truck:
_Binary dependency management that's easy to pick-up!_

## Installation

```sh
brew tap mazyod/homebrew-truck
brew install truck
# or ...
brew install mazyod/homebrew-truck/truck
```

### Upgrade

```sh
# upgrade truck after initial installation
brew upgrade truck
```

## Problem

As iOS developers using Carthage for dependency management, we quickly hit a roadblock trying to distribute pre-built binaries with our repo. Even when trying to use Carthage binary specification, Carthage complained when the pre-built binary was a static framework.

Regardless, we wanted something simple, straight-forward, and mostly automated for our team to use.

## Enter Truck

The way Truck aims to solve this problem is by having a versions specification file somewhere in the cloud, pointing to different compressed archives, which clients can download based on their version requirements. Done.

### Configure Truck for Publishing

Currently, Truck supports Github releases as a hosting service. To configure truck for publishing, two things are required:

1. `~/.truckrc` file that contains Github access token (with repo access).
2. `truck-author.json` in a local directory where you want to manage your Truck "targets".
3. Only if using Github, create a `truck` tag on your hosting repo, which we will upload the files under.

```js
// .truckrc blueprint
{
"GITHUB_TOKEN": "(access token with repo access)"
}
```

You can simply do `truck add Blah whatever`, and truck should create a stub `.truckrc` configuration file for you to fill in. Then, you can use `truck init` to prepare the `truck-author.json` file:

```sh
$ truck init # creates truck-author.json
# in truck-author.json, specify the github user and repo that will host the files.
```

### Publishing a Truck Dependency

To publish a "Target", you'll need a Truck configuration file and a Target spec file..

```sh
$ truck add MyTarget some/path/
$ truck add MyTarget some/file.ext
# we just authored MyTarget-spec.json with some/path/ folder and some/file.ext
$ truck release MyTarget "3.2.5"
# this pushes MyTarget.json to the basepath, and the specified files as a zip to some predefined path
# MyTarget.json will contain an entry "3.2.5" pointing to the zip file location for clients to download
```

### Consuming a Truck Dependency

For clients consuming your dependencies, it is as simple as creating a `truck.json` file with the following format:

```json
[
{
"url": "https://github.com/user/repo/releases/download/truck/target.json",
"version": "3.2.5"
}
]
```

... Then, running `truck sync`!
This will download dependencies into `Truck/Tmp`, then extract the archives into `Truck/TARGET_NAME`.