From 847678bb0701d148748921fe6c1ae861e845354c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 22 Apr 2019 13:29:53 +0200 Subject: [PATCH] Get rid of the "latest" release tag The "latest" tag is a pain to maintain: it's a tag that we delete and re-create at every release. Whenever we delete it, the binaries become unavailable on Github until they are re-generated. Thus, from now on, we conform to good practices (as examplified by the github.com/docker/compose) project and distribute only pinned release. The "nightly" tag remains, for now, as it allows us to distribute beta features. It may disappear in the future. --- .travis.yml | 4 ++-- Makefile | 3 +-- README.rst | 6 +----- cloud/aws.sh | 3 ++- docs/cli_download.rst | 6 ++++++ docs/conf.py | 20 ++++++++++++++++---- docs/install.rst | 5 ++--- docs/quickstart.rst | 5 ++--- 8 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 docs/cli_download.rst diff --git a/.travis.yml b/.travis.yml index dae5471..b419393 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ deploy: skip_cleanup: true on: tags: true - condition: $BUILD_DOCKER = true && $TRAVIS_TAG != "latest" && $TRAVIS_TAG != "nightly" + condition: $BUILD_DOCKER = true && $TRAVIS_TAG != "nightly" # Push to pypi - provider: script @@ -60,4 +60,4 @@ deploy: skip_cleanup: true on: tags: true - condition: $BUILD_PYPI = true && $TRAVIS_TAG != "latest" && $TRAVIS_TAG != "nightly" + condition: $BUILD_PYPI = true && $TRAVIS_TAG != "nightly" diff --git a/Makefile b/Makefile index a4b3019..ce1f6b6 100644 --- a/Makefile +++ b/Makefile @@ -20,9 +20,8 @@ dist/tutor: nightly: ## Create a "nightly" release $(MAKE) tag TAG=nightly -release: ## Create a release, update the "latest" tag and push them to origin +release: ## Create a release tag and push it to origin $(MAKE) tag TAG=v$(shell make version) - $(MAKE) tag TAG=latest tag: @echo "=== Creating tag $(TAG)" diff --git a/README.rst b/README.rst index 027fba0..9c56d2b 100644 --- a/README.rst +++ b/README.rst @@ -30,11 +30,7 @@ Tutor 🎓 Open edX 1-click install for everyone Quickstart ---------- -1. `Download `_ the latest stable release of Tutor, uncompress the file and place the ``tutor`` executable in your path. From the command line:: - - sudo curl -L "https://github.com/regisb/tutor/releases/download/latest/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor - sudo chmod +x /usr/local/bin/tutor - +1. Install the `latest stable release `_ of Tutor (`Instructions for the command line `_) 2. Run ``tutor local quickstart`` 3. You're done! diff --git a/cloud/aws.sh b/cloud/aws.sh index d6a5222..aad9833 100755 --- a/cloud/aws.sh +++ b/cloud/aws.sh @@ -32,7 +32,8 @@ sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker- sudo chmod +x /usr/local/bin/docker-compose echo "=============== Installing tutor" -sudo curl -L "https://github.com/regisb/tutor/releases/download/latest/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor +export TUTOR_VERSION="$(curl -sSL https://api.github.com/repos/regisb/tutor/releases/latest | grep tag_name | sed "s/.*tag_name\": \"\(.*\)\",/\1/g")" +sudo curl -L "https://github.com/regisb/tutor/releases/download/$TUTOR_VERSION/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor sudo chmod +x /usr/local/bin/tutor echo "=============== Pulling vendor docker images" diff --git a/docs/cli_download.rst b/docs/cli_download.rst new file mode 100644 index 0000000..19d2d48 --- /dev/null +++ b/docs/cli_download.rst @@ -0,0 +1,6 @@ +.. _cli_download: + +.. parsed-literal:: + + sudo curl -L "\ https\ ://github.com/regisb/tutor/releases/download/|tutor_version|/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor + sudo chmod +x /usr/local/bin/tutor diff --git a/docs/conf.py b/docs/conf.py index fd0db1b..bde955f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,8 +20,8 @@ # -- Project information ----------------------------------------------------- project = 'Tutor' -copyright = u'2018, Régis Behmo' -author = u'Régis Behmo' +copyright = '2018, Régis Behmo' +author = 'Régis Behmo' # The short X.Y version version = '' @@ -128,8 +128,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'tutor.tex', 'Tutor Documentation', - u'Régis Behmo', 'manual'), + (master_doc, 'tutor.tex', 'Tutor Documentation', 'Régis Behmo', 'manual'), ] @@ -171,3 +170,16 @@ epub_title = project # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html'] + +# Custom variables +import io +import os +here = os.path.abspath(os.path.dirname(__file__)) +about = {} +with io.open(os.path.join(here, "..", "tutor", "__about__.py"), "rt", encoding="utf-8") as f: + exec(f.read(), about) +rst_prolog = """ +.. |tutor_version| replace:: {} +""".format( + about['__version__'], +) diff --git a/docs/install.rst b/docs/install.rst index c7f5762..a43e465 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -26,10 +26,9 @@ Also, the host running the containers should be a 64 bit platform. (images are n Direct binary downloads ----------------------- -The latest binaries can be downloaded from https://github.com/regisb/tutor/releases. From the command line:: +The latest binaries can be downloaded from https://github.com/regisb/tutor/releases. From the command line: - sudo curl -L "https://github.com/regisb/tutor/releases/download/latest/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor - sudo chmod +x /usr/local/bin/tutor +.. include:: cli_download.rst This is the recommended installation method for most people. diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 1a212cc..8684f5c 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -3,10 +3,9 @@ Quickstart ========== -1. `Download `_ the latest stable release of Tutor, uncompress the file and place the ``tutor`` executable in your path. From the command line:: +1. `Download `_ the latest stable release of Tutor, uncompress the file and place the ``tutor`` executable in your path. From the command line: - sudo curl -L "https://github.com/regisb/tutor/releases/download/latest/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor - sudo chmod +x /usr/local/bin/tutor +.. include:: cli_download.rst 2. Run ``tutor local quickstart`` 3. You're done!