Preparing a release - ConnectBox/connectbox-pi GitHub Wiki
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.
- Checkout the connectbox-tools repo. It contains the tooling required to create an image
- 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)
- The build process tags several repos (see the
CONNECTBOX_REPOSin 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)
- Install VMWare or VirtualBox and also install a current version of Vagrant (the Vagrantfile can supports both VirtualBox and VMWare)
- cd into the
deploymentdirectory of theconnectbox-toolsrepository and runvagrant up
- Find a machine running Ubuntu 16.04 and login to it.
- Run the
apt-getcommands listed in thedeployment/Vagrantfileof theconnectbox-toolsrepository. - Checkout the connectbox-tools repo, cd into the
deploymentdirectory of the checkout and runpip3 install -r requirements.txt
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.
- Update the CHANGELOG.md file in the connectbox-pi repository to list any changes since the last build
- 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.
- Make sure that you can perform a passwordless login as root on the target device (the
setup-armbian-host.shin thedeploymentdirectory 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)-
ssh root@<neoip>(pwd: 1234) - Set root password to connectbox per the prompts
- Ctrl^c and do not create any extra accounts
- Put your ssh public key on the device so you don’t need to run ansible with
—-ask-pass
-
- Login to the virtual machine that you've setup in the Release Machine Setup section. You can do that by running
vagrant sshin theconnectbox-tools/deploymentdirectory to login to the virtual machine. - Run
CONNECTBOX_GITHUB_TOKEN=<whatever-it-is> python3 /vagrant/prepare_release.pyon the release machine and follow the instructions. - 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> - 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).
- Publish the release to take it out of draft stage.
- Broadcast availability on slack.