Skip to content

Commit

Permalink
Merge pull request #4274 from tino097/4255-docs-use-current-verion
Browse files Browse the repository at this point in the history
[#4255] docs use current version
  • Loading branch information
amercader committed Jun 7, 2018
2 parents 3c7ad61 + 1ca5bec commit 5fc41ad
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
36 changes: 33 additions & 3 deletions doc/conf.py
Expand Up @@ -183,10 +183,26 @@ def get_status_of_this_version():
return 'unsupported'


def get_current_release_tag():
''' Return the name of the tag for the current release
e.g.: "ckan-2.7.4"
'''
release_tags_ = get_release_tags()

current_tag = "ckan-{}".format(version)

if release_tags_.__contains__(current_tag):
return current_tag
else:
return 'COULD_NOT_DETECT_TAG_VERSION'


def get_latest_release_tag():
'''Return the name of the git tag for the latest stable release.
e.g.: "ckan-2.1.1"
e.g.: "ckan-2.7.4"
This requires git to be installed.
Expand All @@ -212,6 +228,19 @@ def get_latest_release_version():
return version


def get_current_release_version():
'''Return the version number of the current release.
e.g. "2.1.1"
'''
version = get_current_release_tag()[len('ckan-'):]

# TODO: We could assert here that latest_version matches X.Y.Z.

return version


def get_latest_package_name(distro='trusty'):
'''Return the filename of the Ubuntu package for the latest stable release.
Expand Down Expand Up @@ -266,7 +295,8 @@ def write_substitutions_file(**kwargs):
f.write('.. |{name}| replace:: {substitution}\n'.format(
name=name, substitution=substitution))


current_release_tag = get_current_release_tag()
current_release_version = get_current_release_version()
latest_release_tag_value = get_latest_release_tag()
latest_release_version = get_latest_release_version()
latest_minor_version = latest_release_version[:3]
Expand All @@ -276,7 +306,7 @@ def write_substitutions_file(**kwargs):

write_substitutions_file(
latest_release_tag=latest_release_tag_value,
latest_release_version=get_latest_release_version(),
latest_release_version=latest_release_version,
latest_package_name_precise=get_latest_package_name('precise'),
latest_package_name_trusty=get_latest_package_name('trusty'),
latest_package_name_xenial=get_latest_package_name('xenial'),
Expand Down
8 changes: 5 additions & 3 deletions doc/maintaining/installing/install-from-docker-compose.rst
Expand Up @@ -69,9 +69,11 @@ Clone CKAN into a directory of your choice::
git clone https://github.com/ckan/ckan.git

This will use the latest CKAN master, which may not be stable enough for production use.
To use a stable version, checkout the respective tag, e.g.::
To use a stable version, checkout the respective tag, e.g.:

git checkout tags/ckan-2.6.2
.. parsed-literal::
git checkout tags/|latest_release_tag|
----------------------
2. Build Docker images
Expand Down Expand Up @@ -173,7 +175,7 @@ a. Create and configure datastore database

With running CKAN containers, execute the built-in setup scripts against the ``db`` container::

docker exec -it db psql -U ckan -f 00_create_datastore.sql
docker exec -it db psql -U ckan -f 00_create_datastore.sh
docker exec ckan /usr/local/bin/ckan-paster --plugin=ckan datastore set-permissions -c /etc/ckan/production.ini | docker exec -i db psql -U ckan

The first script will create the datastore database and the datastore readonly user in the ``db``
Expand Down

0 comments on commit 5fc41ad

Please sign in to comment.