From 7c8948e6b2946109c0693f0df490961f30e1284d Mon Sep 17 00:00:00 2001 From: Thijs Miedema Date: Fri, 14 May 2021 10:01:48 +0200 Subject: [PATCH] Edit tag determiner for docs, now latest or version. --- .azure/build-documentation.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.azure/build-documentation.yml b/.azure/build-documentation.yml index 5cebcbf1ac..a34ca1598a 100644 --- a/.azure/build-documentation.yml +++ b/.azure/build-documentation.yml @@ -20,7 +20,7 @@ trigger: - '*' branches: include: - - '*' + - 'master' pool: vmImage: ubuntu-20.04 @@ -67,14 +67,23 @@ steps: git clone git@github.com:thijsmie/cddstemp.github.io.git documentation-repo name: get_site_repo displayName: Pull documentation repo - - script: | + - bash: | + set -e -x + if [ "$(Build.SourceBranchName)" = "master" ]; then + echo "###vso[task.setvariable variable=docs_tag;]latest" + else + echo "###vso[task.setvariable variable=docs_tag;]$(echo '$(Build.SourceBranchName)' | grep -Eo '^[[:digit:]]\.[[:digit:]]\.[[:digit:]]')" + fi + name: "determine_docu_tag" + displayName: Determine the documentation version number + - bash: | set -e -x - rm -rf "documentation-repo/docs/c/$(Build.SourceBranchName)" || true - cp -R "build/docs/docs" "documentation-repo/docs/c/$(Build.SourceBranchName)" + rm -rf "documentation-repo/docs/c/${DOCS_TAG}" || true + cp -R "build/docs/docs" "documentation-repo/docs/c/${DOCS_TAG})" cd documentation-repo git add "docs/c/$(Build.SourceBranchName)" git config --local user.name "Azure Pipelines" git config --local user.email "azuredevops@microsoft.com" - (git commit -m "Publishing GitHub Pages $(Build.SourceVersion)" && git push -f origin HEAD:master) || true + (git commit -m "Publishing GitHub Pages ${DOCS_TAG}" && git push origin HEAD:master) || true name: 'commit_pages' displayName: Commit new documentation into repo