2018-05-17 09:49:01 -03:00
|
|
|
# Current docs for the syntax of this file are at:
|
|
|
|
# https://github.com/Microsoft/vsts-agent/blob/master/docs/preview/yamlgettingstarted.md
|
|
|
|
|
|
|
|
name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
|
|
|
|
|
|
|
|
queue:
|
2018-09-11 18:01:13 -03:00
|
|
|
name: 'Hosted Ubuntu 1604'
|
2018-05-17 09:49:01 -03:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- master
|
|
|
|
- 3.7
|
|
|
|
- 3.6
|
|
|
|
paths:
|
|
|
|
include:
|
|
|
|
- Doc/*
|
|
|
|
|
|
|
|
#variables:
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
clean: true
|
|
|
|
fetchDepth: 5
|
|
|
|
|
2018-08-07 12:18:03 -03:00
|
|
|
- script: |
|
|
|
|
git fetch -q origin $(system.pullRequest.targetBranch)
|
|
|
|
if ! git diff --name-only HEAD $(git merge-base HEAD FETCH_HEAD) | grep -qE '(\.rst$|^Doc|^Misc)'
|
|
|
|
then
|
|
|
|
echo "No docs were updated, stopping build process."
|
|
|
|
echo "##vso[task.setvariable variable=NoDocs]true"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
displayName: Detect doc-only changes
|
|
|
|
condition: and(succeeded(), variables['system.pullRequest.targetBranch'])
|
|
|
|
|
2018-05-17 09:49:01 -03:00
|
|
|
- task: UsePythonVersion@0
|
|
|
|
displayName: 'Use Python 3.6 or later'
|
|
|
|
inputs:
|
|
|
|
versionSpec: '>=3.6'
|
2018-08-07 12:18:03 -03:00
|
|
|
condition: and(succeeded(), ne(variables['NoDocs'], 'true'))
|
2018-05-17 09:49:01 -03:00
|
|
|
|
|
|
|
- script: python -m pip install sphinx~=1.6.1 blurb python-docs-theme
|
|
|
|
displayName: 'Install build dependencies'
|
2018-08-07 12:18:03 -03:00
|
|
|
condition: and(succeeded(), ne(variables['NoDocs'], 'true'))
|
2018-05-17 09:49:01 -03:00
|
|
|
|
|
|
|
- script: make check suspicious html PYTHON=python
|
|
|
|
workingDirectory: '$(build.sourcesDirectory)/Doc'
|
|
|
|
displayName: 'Build documentation'
|
2018-08-07 12:18:03 -03:00
|
|
|
condition: and(succeeded(), ne(variables['NoDocs'], 'true'))
|
2018-05-17 09:49:01 -03:00
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: 'Publish build'
|
2018-08-07 12:18:03 -03:00
|
|
|
condition: and(and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')), ne(variables['NoDocs'], 'true'))
|
2018-05-17 09:49:01 -03:00
|
|
|
inputs:
|
|
|
|
PathToPublish: '$(build.sourcesDirectory)/Doc/build'
|
|
|
|
ArtifactName: build
|
|
|
|
publishLocation: Container
|