Preparing a release - ConnectBox/connectbox-pi GitHub Wiki

Background

This is the process for creating a ConnectBox image, suitable for burning by end-users onto microSD. This process can generate images for a NanoPi NEO, and for a Raspberry Pi (tested on Rpi0w and Rpi3) and only requires limited manual intervention. There are once-off steps, and steps per-build.

Once-off steps

  1. Checkout the connectbox-tools repo. It contains the tooling required to create an image
  2. The build process uses the github v3 API to tag repositories, so you need to create a Github API personal access token. The token only needs the public_repo scope (and should only be given that scope, to reduce the scope for damage if it is lost)
  3. The build process tags several repos (see the CONNECTBOX_REPOS in https://github.com/ConnectBox/connectbox-tools/blob/master/deployment/prepare_release.py#L18 for the up-to-date list). The Github account that created the API access token must have write access to each of these repos. If you don't have access to the repositories, ask a person with the owner role in the Github ConnectBox organisation (https://github.com/orgs/ConnectBox/people)

Release Machine Setup (automated)

  1. Install VMWare or VirtualBox and also install a current version of Vagrant (the Vagrantfile can supports both VirtualBox and VMWare)
  2. cd into the deployment directory of the connectbox-tools repository and run vagrant up

Release Machine Setup (manual)

  1. Find a machine running Ubuntu 16.04 and login to it.
  2. Run the apt-get commands listed in the deployment/Vagrantfile of the connectbox-tools repository.
  3. Checkout the connectbox-tools repo, cd into the deployment directory of the checkout and run pip3 install -r requirements.txt

Per-build

This assumes you're using the automated machine setup above. If you're using the manual method, you can probably replace /vagrant with the deployment directory of the connectbox-tools repo that you've checked out on the machine.

  1. Update the CHANGELOG.md file in the connectbox-pi repository to list any changes since the last build
  2. Prepare a your target device with a base operating system image. On a NEO, use the most recent release from the https://github.com/ConnectBox/armbian-build repository. For an RPi, try the most recent release of Raspbian lite, but know that ymmv because their image changes.
  3. Make sure that you can perform a passwordless login as root on the target device (the setup-armbian-host.sh in the deployment directory makes it easy if you have keys already available, and automates the 4 steps below, assuming you're building a NEO image - it's different for an RPi)
    1. ssh root@<neoip> (pwd: 1234)
    2. Set root password to connectbox per the prompts
    3. Ctrl^c and do not create any extra accounts
    4. Put your ssh public key on the device so you don’t need to run ansible with —-ask-pass
  4. Login to the virtual machine that you've setup in the Release Machine Setup section. You can do that by running vagrant ssh in the connectbox-tools/deployment directory to login to the virtual machine.
  5. Run CONNECTBOX_GITHUB_TOKEN=<whatever-it-is> python3 /vagrant/prepare_release.py on the release machine and follow the instructions.
  6. If the process fails before you remove the microSD from the target device, you can continue the process by running CONNECTBOX_GITHUB_TOKEN=<whatever-it-is> python3 /vagrant/prepare_release.py --use-existing-tag --tag=<whatever-tag-you-used-when-it-failed>
  7. Update the description of the github release to add release notes, consider whether this is a pre-release and mark it accordingly (historically, release have been marked as pre-release when they've only had limited testing).
  8. Publish the release to take it out of draft stage.
  9. Broadcast availability on slack.
⚠️ **GitHub.com Fallback** ⚠️