Developer’s Guide

This guide explains how to set up your environment for airshipctl development.

Environment expectations

  • Git

  • Go 1.13

  • Docker

Installing Git

Instructions to install Git are here.

Installing Go 1.13

Instructions to install Golang are here.

The make test verification step requires the GNU Compiler Collection (gcc) to be installed.

To install the GNU Compiler Collection (gcc):

sudo apt-get install gcc

Proxy Setup

If your organization requires development behind a proxy server, you will need to define the following environment variables with your organization’s information:

USE_PROXY=true encapsulates the range of addresses used by airshipctl development environment virtual machines, and is the Kubernetes service CIDR.

Clone airshipctl code

Run the following command to download the latest airshipctl code:

git clone

NOTE: The airshipctl application is a Go module. This means that there is no need to clone the repository into the $GOPATH directory in order to build it. You should be able to build it from any directory as long as $GOPATH is defined correctly.

Installing Docker & Other Tools

Prior to building the airshipctl binary, ensure you have Docker, Ansible & other tools installed in your environment.

There is a script in the airshipctl directory named which can be run to download all the required binaries and packages. This script code can be viewed here.

Standalone instructions to install Docker are here. This is not necessary if you run

Building airshipctl

Run the following command to build the airshipctl binary:

make build

This will compile airshipctl and place the resulting binary into the bin directory.

To test the build, including linting and coverage reports, run:

make test

To run all tests in a containerized environment, run:

make docker-image-test-suite

Docker Images

To build an airshipctl Docker image, run:

make docker-image

Pre-built images are already available at Moreover, in the directory airshipctl/tools/gate/, different scripts are present which will run and download all the required images. The script will download all the required images.

Contribution Guidelines

We welcome contributions. This project has set up some guidelines in order to ensure that

  • code quality remains high

  • the project remains consistent, and

  • contributions follow the open source legal requirements.

Our intent is not to burden contributors, but to build elegant and high-quality open source code so that our users will benefit. Make sure you have read and understood the main airshipctl Contributing Guide.

Structure of the Code

The code for the airshipctl project is organized as follows:

  • The client-facing code is located in cmd/. Code inside of cmd/ is not designed for library reuse.

  • Shared libraries are stored in pkg/.

  • Both commands and shared libraries may require test data fixtures. These should be placed in a testdata/ subdirectory within the command or library.

  • The testutil/ directory contains functions that are helpful for unit tests.

  • The zuul.d/ directory contains Zuul YAML definitions for CI/CD jobs to run.

  • The playbooks/ directory contains playbooks that the Zuul CI/CD jobs will run.

  • The tools/ directory contains scripts used by the Makefile and CI/CD pipeline.

  • The tools/gate directory consists of different scripts. These scripts will setup the environment as per requirements and install all the required packages and binaries. This will also download all the required docker images.

  • The docs/ folder is used for documentation and examples.

  • Go dependencies are managed by go mod and stored in go.mod and go.sum

Git Conventions

We use Git for our version control system. The master branch is the home of the current development candidate. Releases are tagged. We accept changes to the code via Gerrit pull requests. One workflow for doing this is as follows:

  1. git clone the airshipctl repository. For this run the command:

    git clone
  2. Use OpenDev documentation to setup Gerrit with the repo.

  3. When set, use this guide to learn the OpenDev development workflow, in a sandbox environment. You can then apply the learnings to start developing airshipctl.

Go Conventions

We follow the Go coding style standards very closely. Typically, running goimports -w -local ./ will make your code beautiful for you.

We also typically follow the conventions of golangci-lint. Read more:


In order to ensure that all package unit tests follow the same standard and use the same frameworks, airshipctl has a document outlining specific test guidelines maintained separately.