Command-Line Tools

PatchKit Tools is a set of scripts that can be used to access PatchKit capabilities from the command line. With PatchKit Tools you can:

One of most critical PatchKit Tools features is uploading & publishing newly created version at once. For this task, you may use patchkit-tools make-version command with or without parameters.

Prerequirements

You need to have at least basic knowledge of command line (Windows) or bash (Mac OSX, Linux). If you don’t know how to work with those tools, please read the resources listed below:

Installation

  1. Download PatchKit tools distribution for your operating system from GitHub.
  2. Unzip it into any suitable directory.
  3. (Optionally) Set up your PATH variable to point to that directory. (Windows, OSX and Linux instructions)

Upgrading from previous versions

  1. Remove your previous installation directory.
  2. Unzip newly downloaded distribution from GitHub to the same place.

Usage

Every tool is executed by patchkit-tools script (for Windows it is patchkit-tools.bat).

Syntax

patchkit-tools [tool_name] [tool_arguments]

Displaying help and tools list

patchkit-tools --help

Displaying specific tool help

patchkit-tools [tool_name] --help

NOTE! The patchkit-tools commands have no tool for creating an application directly from the command line, so to create the application, please follow the steps in Create the application paragraph in the Getting Started section.

Uploading application version with tools

make-version tool allows you to create a new version of your project by uploading only the diff files. It means you don’t have to upload the entirely new version of your project to PatchKit. If make-version is executed for uploading the very first version of the project, then the whole project content will be uploaded.

make-version syntax

patchkit-tools make-version [-s secret] [-a api_key] [-l label] [-f files] [-c changelog]

make-version examples

Adding a new version

patchkit-tools make-version -s aa11bb22cc33dd55ee66ff77gg88hh99 -a zz99yy88xx77ww66vv55uu44tt33ss22rr11 -l “Second version” -f BuildFolder

Adding new version and assigning the changelog

patchkit-tools make-version -s aa11bb22cc33dd55ee66ff77gg88hh99 -a zz99yy88xx77ww66vv55uu44tt33ss22rr11 -l “Third version” -f BuildFolder -c "-feature 1\n-feature 2"

Type patchkit-tools make-version --help to learn syntax.

Working with channels

Starting from version 3.0.0, PatchKit Tools are supporting Channels. Here you can find how to work with those.

If you’re not sure how channels are working, please visit Channels documentation page.

Uploading a version

Channels are working very similar to regular applications. To upload a new version using PatchKit Tools, you need to upload and publish it to a channel group as you would for any other application. Please note that publishing the version to a channel group won’t publish it to any specific channel. Instead, it will persist it so it can be linked later.

patchkit-tools make-version -a API_KEY -s SECRET -l "1.0" -f path/to/build/folder

Linking version to a channel

When a version is persisted in a group, you may link and publish it using channel-make-version. It works very similar to standard make-version, but uploading your local files to PatchKit servers, it links your group version just as you would do using the Web UI.

channel-make-version basic syntax

patchkit-tools channel-make-version -s <secret> -a <api_key> -l <label>

This basic command will create and link the latest persisted group version for you. It’s the safest option because you may navigate to PatchKit Panel, validate it, and publish when needed.

Selecting a version to link to

You may want to link to a different than the latest version. To do that, you can pass --group-version <version_id> parameter. If you don’t know what version ID to import, use list-versions with your group secret to get a nice view of all your versions data.

Providing a changelog

You can easily provide a changelog using --changelog <content> or --changelog-file <path>.

Publishing automatically

To get your version published right after the linkage, pass the --publish parameter.

Did this page help you? For questions about this part, please use the chatbox on the right or contact support here.

Copyright © 2015 - 2018 Upsoft
All Rights Reserved.