===============================
 Packaging HOWTO for ols-tests
===============================

Preparing
=========

 * Ensure all changes since previous release have been documented in
   NEWS.rst and that the section is for the upcoming release.

 * Set __version__ to (X, Y, Z, 'final', 0) in olstests/__init__.py

 * Create a new debian/changelog entry and summarize the changes from NEWS.rst

   $ dch -U

 * Test that the package build correctly locally and run its tests

   $ bzr bd

 * Test that the package build and run its tests for a different series

   $ autopkgtest .// --setup-commands='apt-get update' -- lxd autopkgtest/ubuntu/trusty/amd64

   Note that this requires a pre-existing lxd image that should be created
   with:

   $ autopkgtest-build-lxd ubuntu:trusty/amd64

 * Note that we mostly support trusty and above for now so testing locally
   can/should be done for those series before uploading (or they will fail
   on launchpad anyway).

 * Commit and tag the release

   $ bzr commit -m 'Release X.Y.Z'
   $ bzr tag ols-tests-<X.Y.Z>

   If additional changes are required for ubuntu:

   $ debcommit


Pushing to launchpad
====================

Push the tagged branch to lp:ols-tests, check the recipes there (bzr lp-open
lp:ols-tests) or define your own if needed to create the packages for the
configured releases.


Uploading to PyPi
=================

Create the tarball in the directory above, sign it and upload it.

$ python setup.py sdist -d .. upload --sign --show-response

If the project is renamed, it needs to be registered:

$ python setup.py register


Opening next release for dev
============================

 * Set __version__ to (X, Y, Z+1, 'dev', 0) in olstests/__init__.py

 * Create a new entry in NEWS.rst named 'dev' to hint that the version
   number for the next release is decided *when* the release is done, not
   when trunk is opened for the next release.

 * bzr commit -m 'open X.Y.Z+1 for dev'
