Skip to content

Commit

Permalink
[FAB-17166] Gate UT, IT and DocBuild
Browse files Browse the repository at this point in the history
Adds a gate behind VerifyBuild that will tell
the other jobs which of them should run depending
on which directories in the source tree have
been updated

Signed-off-by: Brett Logan <Brett.T.Logan@ibm.com>
  • Loading branch information
lindluni committed Dec 1, 2019
1 parent 4947729 commit f0422d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ jobs:
path: 'go/src/github.com/hyperledger/fabric'
displayName: Checkout Fabric Code
- script: make basic-checks native
displayName: Verify Build
displayName: Run Basic Checks
- script: ./ci/scripts/evaluate_commits.sh
name: SetJobTriggers

- job: DocBuild
condition: eq(dependencies.VerifyBuild.outputs['SetJobTriggers.buildDoc'], 'true')
dependsOn: VerifyBuild
pool:
vmImage: ubuntu-18.04
container:
Expand All @@ -40,6 +44,8 @@ jobs:
displayName: Publish Documentation Artifacts

- job: UnitTests
condition: eq(dependencies.VerifyBuild.outputs['SetJobTriggers.runTests'], 'true')
dependsOn: VerifyBuild
pool:
vmImage: ubuntu-18.04
steps:
Expand All @@ -53,6 +59,8 @@ jobs:
displayName: Run Unit Tests

- job: IntegrationTests
condition: eq(dependencies.VerifyBuild.outputs['SetJobTriggers.runTests'], 'true')
dependsOn: VerifyBuild
pool:
vmImage: ubuntu-18.04
strategy:
Expand Down
12 changes: 12 additions & 0 deletions ci/scripts/evaluate_commits.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

if [[ $(git diff-tree --no-commit-id --name-only 'HEAD^..HEAD') == "docs" ]]; then
echo "##vso[task.setvariable variable=buildDoc;isOutput=true]true"
else
echo "##vso[task.setvariable variable=buildDoc;isOutput=true]true"
echo "##vso[task.setvariable variable=runTests;isOutput=true]true"
fi

0 comments on commit f0422d6

Please sign in to comment.