From fbfbe2b7eb4efe19e01fa3bbccdcbac09d3f9b67 Mon Sep 17 00:00:00 2001 From: Oliver Sanders Date: Tue, 21 Aug 2018 09:46:04 +0100 Subject: [PATCH] feedback --- bin/rose-make-docs | 2 +- etc/travis-scripts | 31 ++++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/bin/rose-make-docs b/bin/rose-make-docs index 09c0e65e27..31773fd5a3 100755 --- a/bin/rose-make-docs +++ b/bin/rose-make-docs @@ -286,7 +286,7 @@ if make ${DEBUG} -C "${SPHINX_PATH}" ${BUILDS} ${SPHINX_OPTS}; then if [[ "${DEFAULT_VERSION}" != 'none' ]]; then ( cd "${DOCS_DIR}" - rm "${DEFAULT_ALIAS}" 2>/dev/null || true + rm -f "${DEFAULT_ALIAS}" 2>/dev/null ln -s "${DEFAULT_VERSION:-$ROSE_VERSION}" "${DEFAULT_ALIAS}" ) fi diff --git a/etc/travis-scripts b/etc/travis-scripts index 2f5265b1ba..ff49e4d857 100755 --- a/etc/travis-scripts +++ b/etc/travis-scripts @@ -1,5 +1,22 @@ -#!/bin/bash - +#!/usr/bin/env bash +#------------------------------------------------------------------------------- +# (C) British Crown Copyright 2012-8 Met Office. +# +# This file is part of Rose, a framework for meteorological suites. +# +# Rose is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Rose is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Rose. If not, see . +#------------------------------------------------------------------------------- set -eu set -o xtrace # for ease of debugging travis builds shopt -s extglob @@ -116,12 +133,8 @@ build-docs () { # if we are not building the most recent tag then leave the default # docs version (symlinked from the web root) unchanged - LATEST_TAG="$(git ls-remote --tags "${GITHUB_REPO}" | \ - awk '{print $2}' | \ - grep -E 'refs/tags/[^\{\}]+$' | \ - cut -d '/' -f 3 | \ - sort | \ - tail -n 1)" + LATEST_TAG="$(git ls-remote --tags --refs 'http://github.com/metomi/rose' \ + | sed 's/.*refs\/tags\/\(.*\)/\1/' | sort | tail -n 1)" if [[ "${LATEST_TAG}" != "${TRAVIS_TAG}" ]]; then DEFAULT_VERSION="--default-version none" fi @@ -130,7 +143,7 @@ build-docs () { if ! rose make-docs --venv --dev --strict clean html slides pdf \ ${DEFAULT_VERSION:-} >out 2>&1; then # output is a bit long, only output it if the docs fail to build - cat out + cat out >2 exit 1 fi