Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 2.45 KB

README.md

File metadata and controls

59 lines (47 loc) · 2.45 KB

Farmer Client License

Command-line program to manage a Farmer server instance.

Installation

You need to run go get to build and run farmer-cli:

go get github.com/farmer-project/farmer-cli

Important Note

Make sure you have an already running Farmer server read its README.md, because before you can create your boxes you need to know about .farmer.yml file

Usage

First you need to configure your client. (You will need your Farmer server API URL after you've had a successful farmer server installation.)

farmer-cli configure

Create a Box

To create a box you need to specify a unique name and a repository url along with a git pathspec which can be a specific branch or tag.

Some examples are:

farmer-cli create alice_app --repository=https://github.com/foo/app.git --pathspec=tags/v0.2
farmer-cli create bob_app -r https://github.com/foo/app.git -p master
farmer-cli create carol_app --repository=https://github.com/foo/carol-app.git # Uses "master" branch by default.

Assign a Domain to a Box

Any box can have as many domains as you like using domain command like below:

farmer-cli domain-add alice_app --domain=alice-app.com --port=8080
farmer-cli domain-add bob_app --domain=bob-app.com # port 80 by default.

farmer-cli domain-remove alice_app --domain=alice-app.com

Deploy on a Box

Deploying on a box means you want to upgrade that box's source code to simply fetch new changes of the branch that this box is created upon. You provide a new pathspec (git branch or a git tag) and farmer fetches the new code and runs the deploy script if it is defined in .farmer.yml

farmer-cli deploy alice_app --pathspec=tags/v3.4
farmer-cli deploy bob_app --pathspec=feature/my-new-feature

Destroy a Box

Completely removes a box and its source codes, database and user created content if any.

farmer-cli destroy carol_app

List of all Boxes

Lists all created boxes along with their state if they're running or not.

farmer-cli list

License

Visit our MIT License.