Add latest symlink

This commit is contained in:
Darko Poljak 2019-05-02 19:34:46 +02:00
parent de4ff192bd
commit c2c0202e5b
2 changed files with 6 additions and 3 deletions

View file

@ -49,11 +49,12 @@ release-prepare:
@rsync -a "$(CDIST_DOCS_HTML_DIST_DIR)/" "$(WEBSITE_MANUALS_DIR)/$(CDIST_CHANGELOG_VERSION)/" @rsync -a "$(CDIST_DOCS_HTML_DIST_DIR)/" "$(WEBSITE_MANUALS_DIR)/$(CDIST_CHANGELOG_VERSION)/"
release-prepare-latest: release-prepare release-prepare-latest: release-prepare
@grep '$(CDIST_CHANGELOG_VERSION)' "$(WEBSITE_MAN_PAGE)" || awk 'FNR == 11 { print "* `$(CDIST_CHANGELOG_VERSION) <manuals/$(CDIST_CHANGELOG_VERSION)>`_"; print; next; } /^\* `Latest manual/ { print "* `Latest manual <manuals/$(CDIST_CHANGELOG_VERSION)>`_"; next; } { print; }' "$(WEBSITE_MAN_PAGE)" > "$(WEBSITE_MAN_PAGE)-new" && mv "$(WEBSITE_MAN_PAGE)-new" "$(WEBSITE_MAN_PAGE)" || exit 0 @grep '$(CDIST_CHANGELOG_VERSION)' "$(WEBSITE_MAN_PAGE)" || awk 'FNR == 11 { print "* `$(CDIST_CHANGELOG_VERSION) <manuals/$(CDIST_CHANGELOG_VERSION)>`_"; print; next; } { print; }' "$(WEBSITE_MAN_PAGE)" > "$(WEBSITE_MAN_PAGE)-new" && mv "$(WEBSITE_MAN_PAGE)-new" "$(WEBSITE_MAN_PAGE)" || exit 0
# Build website. # Build website.
build: build:
$(SPHINXH) $(SPHINXH)
@cd "$(WEBSITE_HTML_DIST_DIR)/manuals" && rm -f latest && ln -s "$(CDIST_CHANGELOG_VERSION)" latest
release: release-prepare-latest build release: release-prepare-latest build
@ -66,8 +67,10 @@ publish:
&& rm -f "../$(WEBSITE_ARCHIVE)" && rm -f "../$(WEBSITE_ARCHIVE)"
@ssh "$(WEBSITE_REMOTE_HOST)" "cd $(WEBSITE_REMOTE_DIR) && tar -x -f $(WEBSITE_ARCHIVE) && rm -f $(WEBSITE_ARCHIVE)" @ssh "$(WEBSITE_REMOTE_HOST)" "cd $(WEBSITE_REMOTE_DIR) && tar -x -f $(WEBSITE_ARCHIVE) && rm -f $(WEBSITE_ARCHIVE)"
# Publish static website # Publish static website.
# Update latest symlink.
release-publish: release publish release-publish: release publish
@ssh "$(WEBSITE_REMOTE_HOST)" "cd '$(WEBSITE_REMOTE_DIR)/manuals' && rm -f latest && ln -s '$(CDIST_CHANGELOG_VERSION)' latest"
release-publish-no-latest: release-no-latest publish release-publish-no-latest: release-no-latest publish

View file

@ -1,7 +1,7 @@
cdist manual cdist manual
============ ============
* `Latest manual <manuals/4.11.1>`_ * `Latest manual <manuals/latest>`_
* Checking out **beta** branch, i.e. cdist **trigger** and **preos** functionality? * Checking out **beta** branch, i.e. cdist **trigger** and **preos** functionality?
Find the manual `here <manuals/beta>`_. Find the manual `here <manuals/beta>`_.