Versions
+-
+{versions}
+
diff --git a/.gitignore b/.gitignore index a5de41ba388c..841d616a69d9 100644 --- a/.gitignore +++ b/.gitignore @@ -49,5 +49,6 @@ regression/local_test_setup # Make sure a generated file isn't accidentally committed. pylintrc_reduced -# Wheel directory used in Travis builds. +# Travis build directories. gcloud-python-wheels/ +ghpages/ diff --git a/scripts/get_version.py b/scripts/get_version.py index 42dd4a9f6259..c029b5b7fe21 100644 --- a/scripts/get_version.py +++ b/scripts/get_version.py @@ -1,3 +1,18 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Simple script to get the gcloud version.""" + from pkg_resources import get_distribution print get_distribution('gcloud').version diff --git a/scripts/update_docs.sh b/scripts/update_docs.sh index b4b4e8a67389..fd82baa804a9 100755 --- a/scripts/update_docs.sh +++ b/scripts/update_docs.sh @@ -51,6 +51,11 @@ else # Put the new release in latest and with the actual version. cp -R ../docs/_build/html/ latest/ cp -R ../docs/_build/html/ "${CURRENT_VERSION}/" + + # Also update the versions file. + ../.tox/docs/bin/python ../scripts/update_versions.py + # Update the files which were updated in the release. + git add versions.html versions.json fi # Update the files push to gh-pages. diff --git a/scripts/update_versions.py b/scripts/update_versions.py new file mode 100644 index 000000000000..6d22cdb28ae3 --- /dev/null +++ b/scripts/update_versions.py @@ -0,0 +1,83 @@ +# Copyright 2014 Google Inc. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Simple script to update the gcloud versions list and file.""" + +import json +import os +from pkg_resources import get_distribution + + +LI_TEMPLATE = '