This repository has been archived by the owner. It is now read-only.
⚓️ ⚓️ Command Line Interface for Harbor.
Switch branches/tags
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.
harbor
packages
.gitignore
.travis.yml
CHANGELOG.md
CODE_OF_CONDUCT.md
LICENSE
README.md

README.md

Harbor · Build Status PyPI version

Harbor-CLI is a tool to share Android builds of React Native projects.

With an intuitive CLI for developers, and a simple but effective mobile app for clients and QAs, you won't have to deal with the hassle of building and deploying your awesome React Native projects again.

(Note: This repo houses only the CLI for Harbor. The mobile app lives in a different repo.)

(Please take a look at the board for issues and contributing.)

Requirements

  • A linux or macOS/OSX system (Windows compatibility has never been checked and never will be)
  • Python 3.3 to 3.6

Python 2 is unsupported.

Installation

A global install would probably be more convenient, but you can create a Python 3 virtual environment too.

virtualenv --python=$(which python3) harbor-virtualenv

source harbor-virtualenv/bin/activate

You can then install harbor with pip3 (just pip if you are in a virtualenv)

pip3 install harbor-cli

This makes available a harbor CLI command. You can run harbor --help to see supported commands or see below for usage instructions.

API

All commands come with a --help flag, so that you don't have to keep coming back here. 🙃

(All the commands must be run in the root of a valid Android or React Native project)

Registration using harbor register

Register your project using harbor register or register a new user with the --user flag.

Usage: harbor register [OPTIONS]

  Register your project/user on the server.

Options:
  --user  Flag to indicate if a user is to be registered.
  --help  Show this message and exit.

Invite others to join your project using harbor invite

Invite your friends and colleagues under a role.

Usage: harbor invite [OPTIONS] EMAIL

  Invite someone to the project.

Options:
  --role TEXT  Role to register the user under [qa, uat, dev]. This
               affects how they receive updates regarding releases.
               Default value of "dev" is assumed.
  --help       Show this message and exit.

Deploy your project using harbor deploy

Deploy your project with one command. You can set a deployment preset of qa, uat, or dev. By default, harbor will pause for confirmation before final deployment. Use the --noconfirm flag to disable this behavior.

Usage: harbor deploy [OPTIONS]

  Deploy your project once it has been registered.

Options:
  --deploy-type TEXT  Release type [qa, uat, dev].        This affects the
                      audience that receives notice of this release.
                      Default value of "dev" is assumed
  --noconfirm TEXT    Don't ask for confirmation
  --help              Show this message and exit.

Third party services

Third party services are enabled using a configuration file harborConfig.json - at the root of your project directory.

HipChat

Example config:

{
  "hipchat": {
    "company_name": "your_company_name",
    "room_id": 1234,
    "auth_token": "your_super_secret_token"
  }
}

Workflow

How does the deployment process for a React Native app look like?

  1. For the first time, you need to register your project. Run harbor register. That's it.
  2. Invite people to your project using harbor invite [email]. * You can supply a role option using --role=[role]. Currently, 'dev', 'uat', 'qa' are supported. This falls back to dev if unspecified.
  3. Deploy your project using harbor deploy. Easy. * You can supply a type option using --type=[releaseType]. Currently, 'dev', 'uat', 'qa' are supported. This falls back to dev if unspecified and determines how push notifications are sent to users. For example, a 'dev' release will be sent to only people invited under the 'dev' role.

Contributing

Please take a look at the issues page if you'd like to contribute. I'm open to any other changes you might recommend, so be sure to open a issue if you'd like to discuss.

Running locally:

Clone the repo, then just run:

pip install --editable .

Be sure to use the t script to automate linting and tests. Watch your tests with pytestwatch and the pytest.ini config.

When creating a pull request, please make sure you do the following:

  1. Make sure no tests break, and add many (practical) tests to your feature as possible.
  2. An Angular-esque commit standard is preferred. Prefix your commits with (chore), (feat), (docs), (fix) etc.