Skip to content

Commit 4680efc

Browse files
jt-ntimbwhite
authored andcommitted
Publish javadoc
Signed-off-by: James Taylor <[email protected]>
1 parent d4981a3 commit 4680efc

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

ci/azure-pipelines.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,39 @@ stages:
9292
pathToPublish: $(Build.ArtifactStagingDirectory)/fabric-javaenv.tar.gz
9393
artifactName: javaenv-docker-image
9494

95+
- job: javadoc
96+
condition: and(succeeded(),eq(variables['Build.Reason'], 'IndividualCI'))
97+
steps:
98+
- checkout: self
99+
persistCredentials: true
100+
- script: ./gradlew javadoc
101+
displayName: 'Build JavaDoc'
102+
- script: |
103+
if [ -d docs ]; then
104+
mkdir gh-pages
105+
cp -r docs/* gh-pages
106+
fi
107+
displayName: 'Copy gh-pages doc'
108+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
109+
- script: |
110+
git fetch origin
111+
git checkout -b gh-pages origin/gh-pages
112+
mkdir -p $(Build.SourceBranchName)/api
113+
cp -r fabric-chaincode-shim/build/docs/javadoc/* $(Build.SourceBranchName)/api
114+
if [ -d gh-pages ]; then
115+
find . -maxdepth 1 ! \( -name [.]* -o -name 'gh-pages' -o -name 'master' -o -name 'release-*' \) -exec rm -rf {} \;
116+
cp -r gh-pages/* .
117+
rm -rf gh-pages
118+
fi
119+
displayName: 'Update gh-pages branch'
120+
- script: |
121+
git config --local user.name "Azure Pipelines"
122+
git config --local user.email "[email protected]"
123+
git add -A
124+
git commit -m "Publishing GitHub Pages"
125+
git push origin gh-pages
126+
displayName: 'Commit gh-pages changes'
127+
95128
# Publish the snapshot images etc.
96129
# Original source of these is https://github.com/hyperledger/ci-management/blob/master/jjb/fabric-chaincode-java/shell/include-raw-publish-docker-jar.sh
97130
- job: snapshot_publish

0 commit comments

Comments
 (0)