Merge pull request #163 from kevgliss/docs

Updating docs
This commit is contained in:
kevgliss 2015-12-01 10:07:37 -08:00
commit fcc3c35ae2
8 changed files with 117 additions and 104 deletions

View File

@ -55,10 +55,12 @@ copyright = u'2015, Netflix Inc.'
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
# built documents. # built documents.
# #
# The short X.Y version. base_dir = os.path.join(os.path.dirname(__file__), os.pardir)
version = get_version() about = {}
# The full version, including alpha/beta/rc tags. with open(os.path.join(base_dir, "lemur", "__about__.py")) as f:
release = get_version() exec(f.read(), about)
version = release = about["__version__"]
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

53
docs/doing-a-release.rst Normal file
View File

@ -0,0 +1,53 @@
Doing a release
===============
Doing a release of ``lemur`` requires a few steps.
Bumping the version number
--------------------------
The next step in doing a release is bumping the version number in the
software.
* Update the version number in ``lemur/__about__.py``.
* Set the release date in the :doc:`/changelog`.
* Do a commit indicating this.
* Send a pull request with this.
* Wait for it to be merged.
Performing the release
----------------------
The commit that merged the version number bump is now the official release
commit for this release. You will need to have ``gpg`` installed and a ``gpg``
key in order to do a release. Once this has happened:
* Run ``invoke release {version}``.
The release should now be available on PyPI and a tag should be available in
the repository.
Verifying the release
---------------------
You should verify that ``pip install lemur`` works correctly:
.. code-block:: pycon
>>> import lemur
>>> lemur.__version__
'...'
Verify that this is the version you just released.
Post-release tasks
------------------
* Update the version number to the next major (e.g. ``0.5.dev1``) in
``lemur/__about__.py`` and
* Add new :doc:`/changelog` entry with next version and note that it is under
active development
* Send a pull request with these items
* Check for any outstanding code undergoing a deprecation cycle by looking in
``lemur.utils`` for ``DeprecatedIn**`` definitions. If any exist open
a ticket to increment them for the next release.

View File

@ -14,6 +14,11 @@ I am seeing Lemur's javascript load in my browser but not the CSS.
:doc:`production/index` for example configurations. :doc:`production/index` for example configurations.
After installing Lemur I am unable to login
Ensure that you are trying to login with the credentials you entered during `lemur init`. These are separate
from the postgres database credentials.
Running 'lemur db upgrade' seems stuck. Running 'lemur db upgrade' seems stuck.
Most likely, the upgrade is stuck because an existing query on the database is holding onto a lock that the Most likely, the upgrade is stuck because an existing query on the database is holding onto a lock that the
migration needs. migration needs.

View File

@ -1,45 +0,0 @@
# Source: https://github.com/Changaco/version.py
from os.path import dirname, isdir, join
import re
from subprocess import CalledProcessError, check_output
PREFIX = ''
tag_re = re.compile(r'\btag: %s([0-9][^,]*)\b' % PREFIX)
version_re = re.compile('^Version: (.+)$', re.M)
def get_version():
# Return the version if it has been injected into the file by git-archive
version = tag_re.search('$Format:%D$')
if version:
return version.group(1)
d = dirname(__file__)
if isdir(join(d, '.git')):
# Get the version using "git describe".
cmd = 'git describe --tags --match %s[0-9]* --dirty' % PREFIX
try:
version = check_output(cmd.split()).decode().strip()[len(PREFIX):]
except CalledProcessError:
raise RuntimeError('Unable to get version number from git tags')
# PEP 440 compatibility
if '-' in version:
if version.endswith('-dirty'):
raise RuntimeError('The working tree is dirty')
version = '.post'.join(version.split('-')[:2])
else:
# Extract the version from the PKG-INFO file.
with open(join(d, 'PKG-INFO')) as f:
version = version_re.search(f.read()).group(1)
return version
if __name__ == '__main__':
print(get_version())

18
lemur/__about__.py Normal file
View File

@ -0,0 +1,18 @@
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "lemur"
__summary__ = ("Certificate management and orchestration service")
__uri__ = "https://github.com/Netflix/lemur"
__version__ = "0.2"
__author__ = "The Lemur developers"
__email__ = "security@netflix.com"
__license__ = "Apache License, Version 2.0"
__copyright__ = "Copyright 2015 {0}".format(__author__)

View File

@ -8,6 +8,8 @@
""" """
from __future__ import absolute_import, division, print_function
from lemur import factory from lemur import factory
from lemur.users.views import mod as users_bp from lemur.users.views import mod as users_bp
@ -22,6 +24,16 @@ from lemur.plugins.views import mod as plugins_bp
from lemur.notifications.views import mod as notifications_bp from lemur.notifications.views import mod as notifications_bp
from lemur.sources.views import mod as sources_bp from lemur.sources.views import mod as sources_bp
from lemur.__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
LEMUR_BLUEPRINTS = ( LEMUR_BLUEPRINTS = (
users_bp, users_bp,

View File

@ -9,6 +9,7 @@ Is a TLS management and orchestration tool.
""" """
from __future__ import absolute_import from __future__ import absolute_import
import sys
import json import json
import os.path import os.path
import datetime import datetime
@ -21,10 +22,17 @@ from setuptools.command.sdist import sdist
from setuptools import setup, find_packages from setuptools import setup, find_packages
from subprocess import check_output from subprocess import check_output
from version import get_version
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__))) ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
# When executing the setup.py, we need to be able to import ourselves, this
# means that we need to add the src/ directory to the sys.path.
sys.path.insert(0, ROOT)
about = {}
with open(os.path.join(ROOT, "lemur", "__about__.py")) as f:
exec(f.read(), about)
install_requires = [ install_requires = [
'Flask==0.10.1', 'Flask==0.10.1',
'Flask-RESTful==0.3.3', 'Flask-RESTful==0.3.3',
@ -125,13 +133,12 @@ class BuildStatic(Command):
log.warn("Unable to build static content") log.warn("Unable to build static content")
setup( setup(
name='lemur', name=about["__title__"],
version=get_version(), version=about["__version__"],
author='Kevin Glisson', author=about["__author__"],
author_email='kglisson@netflix.com', author_email=about["__email__"],
url='https://github.com/netflix/lemur', url=about["__uri__"],
download_url='https://github.com/Netflix/lemur/archive/{0}.tar.gz'.format(get_version()), description=about["__summary__"],
description='Certificate management and orchestration service',
long_description=open(os.path.join(ROOT, 'README.rst')).read(), long_description=open(os.path.join(ROOT, 'README.rst')).read(),
packages=find_packages(), packages=find_packages(),
include_package_data=True, include_package_data=True,
@ -164,6 +171,12 @@ setup(
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'Intended Audience :: System Administrators', 'Intended Audience :: System Administrators',
'Operating System :: OS Independent', 'Operating System :: OS Independent',
'Topic :: Software Development' 'Topic :: Software Development',
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License"
] ]
) )

View File

@ -1,45 +0,0 @@
# Source: https://github.com/Changaco/version.py
from os.path import dirname, isdir, join
import re
from subprocess import CalledProcessError, check_output
PREFIX = ''
tag_re = re.compile(r'\btag: %s([0-9][^,]*)\b' % PREFIX)
version_re = re.compile('^Version: (.+)$', re.M)
def get_version():
# Return the version if it has been injected into the file by git-archive
version = tag_re.search('$Format:%D$')
if version:
return version.group(1)
d = dirname(__file__)
if isdir(join(d, '.git')):
# Get the version using "git describe".
cmd = 'git describe --tags --match %s[0-9]* --dirty' % PREFIX
try:
version = check_output(cmd.split()).decode().strip()[len(PREFIX):]
except CalledProcessError:
raise RuntimeError('Unable to get version number from git tags')
# PEP 440 compatibility
if '-' in version:
if version.endswith('-dirty'):
raise RuntimeError('The working tree is dirty')
version = '.post'.join(version.split('-')[:2])
else:
# Extract the version from the PKG-INFO file.
with open(join(d, 'PKG-INFO')) as f:
version = version_re.search(f.read()).group(1)
return version
if __name__ == '__main__':
print(get_version())