Use the Command Line Interface (CLI)

V2✨ V3 ✨

Do you want to deploy from the command line? Headles Operations / Iterapp has a CLI that can be used to deploy from the CLI, without using Slack. Slack is easier to get started with, but at some point you might want to have a CLI.

HOPS has a CLI that can be used to deploy.

Install

Using magic pipe-to-bash

curl -SsLf https://cli.headless-operations.no/install.sh | sh

Using magic pipe-to-bash, but with more control

Run the following to get the help and see the parameters

curl -SsLf https://cli.headless-operations.no/install.sh | sh -s -- -h

Download yourself

Get the URL from one of the following links

Upgrade

Run

hops self-update

(or download using one of the above links and replace the binary)

Uninstall

rm $HOME/bin/hops

Use the CLI

Login

Find the name of your cluster (for iterapp, the name is iterapp)

Run

V2✨ V3 ✨
hops login --cluster=CLUSTER_NAME
hops v3 login

and follow the instruction. You will be asked to create a auth token in the frontend for your cluster.

Switch the current cluster

V2✨ V3 ✨

If you have logged in to multiple clusters, you can change the current cluster by running.

hops config set-cluster CLUSTER_NAME

List all your logged in cluster by running

hops config list-clusters

In V3, clusters are selected per-app when they are registered.

Get help

V2✨ V3 ✨
hops help
hops v3 help

or get help with a command

V2✨ V3 ✨
hops deploy --help
hops v3 deploy --help

Deploy a app

If you are in the git-folder of the app, and want to deploy main to prod, you can run

V2✨ V3 ✨
hops deploy
hops v3 deploy

If you want to specify app, branch or environment, you can do that using flags

V2✨ V3 ✨
hops deploy -a my_app -e snap0 -r my-cool-branch
hops v3 deploy -a iterate/my_app -e snap0 -r my-cool-branch

List all your apps

V2✨ V3 ✨
hops list-apps
hops v3 list-apps

(Re)build a branch

This is only required if the previous build failed. It should happen automatically.

V2✨ V3 ✨
hops build -a my_app -r my-cool-branch
hops v3 build create -a iterate/my_app my-cool-branch