diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..202ce833 --- /dev/null +++ b/.gitignore @@ -0,0 +1,69 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +doc/build/ + +# PyBuilder +target/ + +# virtualenv +.venv/ + +# jenkins config +jenkins/config.ini +playbooks/debug.yml + +# Files created by releasenotes build +releasenotes/build + +# Editors +.*.sw[klmnop] + diff --git a/ansible-requirements.txt b/ansible-requirements.txt new file mode 100644 index 00000000..a1b68382 --- /dev/null +++ b/ansible-requirements.txt @@ -0,0 +1,6 @@ +# These are required here because ansible can't be in global-requirements due +# to licensing conflicts. But we sill need to be able to pull them in for +# lint checks and want to document these as ansible specific things that may +# be required for this repository. +ansible +ansible-lint diff --git a/ci-scripts/ansible-lint.sh b/ci-scripts/ansible-lint.sh new file mode 100755 index 00000000..4cf4af32 --- /dev/null +++ b/ci-scripts/ansible-lint.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# ANSIBLE0006: Using command rather than module +# we have a few use cases where we need to use curl and rsync +# ANSIBLE0016: Tasks that run when changed should likely be handlers +# this requires refactoring roles, skipping for now +# ANSIBLE0012: Commands should not change things if nothing needs doing +# this requires refactoring roles, skipping for now +SKIPLIST="ANSIBLE0006,ANSIBLE0016,ANSIBLE0012" + +# lint the playbooks separately to avoid linting the roles multiple times +for DIR in tasks playbooks; do + if [ -d "$DIR" ]; then + pushd $DIR + for playbook in `find . -type f -regex '.*\.y[a]?ml'`; do + ansible-lint -vvv -x $SKIPLIST $playbook || lint_error=1 + done + popd + fi +done + +# lint all the possible roles +# Due to https://github.com/willthames/ansible-lint/issues/210, the roles +# directories need to contain a trailing slash at the end of the path. +if [ -d ./roles ]; then + for rolesdir in `find ./roles -maxdepth 1 -type d`; do + ansible-lint -vvv -x $SKIPLIST $rolesdir/ || lint_error=1 + done +fi + +# exit with 1 if we had a least an error or warning. +if [[ -n "$lint_error" ]]; then + exit 1; +fi diff --git a/ci-scripts/releasenotes_tox.sh b/ci-scripts/releasenotes_tox.sh new file mode 100755 index 00000000..f112910b --- /dev/null +++ b/ci-scripts/releasenotes_tox.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +rm -rf releasenotes/build + +sphinx-build -a -E -W \ + -d releasenotes/build/doctrees \ + -b html \ + releasenotes/source releasenotes/build/html +BUILD_RESULT=$? + +UNCOMMITTED_NOTES=$(git status --porcelain | \ + awk '$1 ~ "M|A|??" && $2 ~ /releasenotes\/notes/ {print $2}') + +if [ "${UNCOMMITTED_NOTES}" ]; then + cat < v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'tripleo-upgradeReleaseNotesdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + #'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ('index', 'tripleo-upgradeReleaseNotes.tex', + u'tripleo-upgrade Release Notes Documentation', + u'2016, TripleO Developers', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'tripleo-upgradereleasenotes', + u'tripleo-upgrade Release Notes Documentation', + [u'2016, TripleO Developers'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'tripleo-upgradeReleaseNotes', + u'tripleo-upgrade Release Notes Documentation', + u'2016, TripleO Developers', 'tripleo-upgradeReleaseNotes', + 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + +# -- Options for Internationalization output ------------------------------ +locale_dirs = ['locale/'] + +# openstackdocstheme options +repository_name = 'openstack/tripleo-upgrade' +bug_project = 'tripleo' +bug_tag = 'documentation' diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst new file mode 100644 index 00000000..a16ea14a --- /dev/null +++ b/releasenotes/source/index.rst @@ -0,0 +1,18 @@ +================================================ +Welcome to tripleo-upgrade Release Notes! +================================================ + +Contents +======== + +.. toctree:: + :maxdepth: 2 + + unreleased + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` diff --git a/releasenotes/source/unreleased.rst b/releasenotes/source/unreleased.rst new file mode 100644 index 00000000..2334dd5c --- /dev/null +++ b/releasenotes/source/unreleased.rst @@ -0,0 +1,5 @@ +============================== + Current Series Release Notes +============================== + + .. release-notes:: diff --git a/templates/create_registry_env.sh.j2 b/templates/create_registry_env.sh.j2 index 26800827..3637ffe3 100644 --- a/templates/create_registry_env.sh.j2 +++ b/templates/create_registry_env.sh.j2 @@ -5,10 +5,11 @@ set -euo pipefail {% if upstream_container_images %} {% if use_local_docker_registry %} -echo > {{ containers_default_parameters }} 'parameter_defaults: +cat > {{ containers_default_parameters }} <=0.12.0 # Apache-2.0 +bashate>=0.5.1 # Apache-2.0 + +# this is required for the docs build jobs +reno>=2.5.0 # Apache-2.0 +sphinx>=1.6.2 # BSD +openstackdocstheme>=1.17.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..9eeaac21 --- /dev/null +++ b/tox.ini @@ -0,0 +1,79 @@ +[tox] +minversion = 1.6 +envlist = docs, linters +skipdist = True + +[testenv] +usedevelop = True +install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} +setenv = VIRTUAL_ENV={envdir} +deps = -r{toxinidir}/test-requirements.txt +whitelist_externals = bash + +[testenv:bindep] +# Do not install any requirements. We want this to be fast and work even if +# system dependencies are missing, since it's used to tell you what system +# dependencies are missing! This also means that bindep must be installed +# separately, outside of the requirements files. +deps = bindep +commands = bindep test + +[testenv:docs] +commands = python setup.py build_sphinx + +[testenv:bashate] +commands = +# Run bashate check for all bash scripts +# Ignores the following rules: +# E006: Line longer than 79 columns (as many scripts use jinja +# templating, this is very difficult) +# E040: Syntax error determined using `bash -n` (as many scripts +# use jinja templating, this will often fail and the syntax +# error will be discovered in execution anyway) + bash -c "git ls-files | xargs grep --binary-files=without-match \ + --files-with-match '^.!.*\(ba\)\?sh$' \ + --exclude-dir .tox \ + --exclude-dir .git \ + | xargs bashate --error . --verbose --ignore=E006,E040" + +[testenv:pep8] +commands = + # Run hacking/flake8 check for all python files + bash -c "git ls-files | grep -v releasenotes | xargs grep --binary-files=without-match \ + --files-with-match '^.!.*python$' \ + --exclude-dir .tox \ + --exclude-dir .git \ + --exclude-dir .eggs \ + --exclude-dir *.egg-info \ + --exclude-dir dist \ + --exclude-dir *lib/python* \ + --exclude-dir doc \ + | xargs flake8 --verbose" + +[testenv:ansible-lint] +basepython=python2 +commands = + bash ci-scripts/ansible-lint.sh + +[testenv:linters] +deps = + -r{toxinidir}/test-requirements.txt + -r{toxinidir}/ansible-requirements.txt +commands = + {[testenv:bashate]commands} + {[testenv:pep8]commands} + {[testenv:ansible-lint]commands} + +[testenv:releasenotes] +whitelist_externals = bash +commands = bash -c ci-scripts/releasenotes_tox.sh + +[testenv:venv] +commands = {posargs} + +[flake8] +# E123, E125 skipped as they are invalid PEP-8. +# E265 deals withs paces inside of comments +show-source = True +ignore = E123,E125,E265 +builtins = _