Skip to content

Commit 1e26293

Browse files
jt-ntimbwhite
authored andcommitted
[FABCN-378] Publish jsdoc
Signed-off-by: James Taylor <jamest@uk.ibm.com>
1 parent 9bcd0b3 commit 1e26293

28 files changed

Lines changed: 549 additions & 629 deletions

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ tools/toolchain/network/crypto-material/*.tx
2121
tools/toolchain/network/crypto-material/crypto-config
2222
tools/toolchain/network/crypto-material/core.yaml
2323

24-
docs/**/_out
25-
2624
# Rush files
2725
common/temp/**
2826
**/.rush/temp/**
@@ -32,3 +30,6 @@ common/temp/**
3230
package-deps.json
3331
test-results.xml
3432
docker.log
33+
34+
# jsdoc output
35+
docs/gen

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
# Hyperledger Fabric - Node.js Contracts
22

3-
This is the project to support the writing of Contracts with the node.js runtime.
3+
[![Build Status](https://dev.azure.com/Hyperledger/Fabric-Chaincode-Node/_apis/build/status/Fabric-Chaincode-Node?branchName=master)](https://dev.azure.com/Hyperledger/Fabric-Chaincode-Node/_build/latest?definitionId=33&branchName=master)
4+
[![fabric-contract-api npm module](https://img.shields.io/npm/v/fabric-shim?label=fabric-contract-api)](https://www.npmjs.com/package/fabric-contract-api)
5+
[![fabric-shim npm module](https://img.shields.io/npm/v/fabric-shim?label=fabric-shim)](https://www.npmjs.com/package/fabric-shim)
6+
[![fabric-shim-api npm module](https://img.shields.io/npm/v/fabric-shim?label=fabric-shim-api)](https://www.npmjs.com/package/fabric-shim-api)
7+
[![fabric-shim-crypto npm module](https://img.shields.io/npm/v/fabric-shim?label=fabric-shim-crypto)](https://www.npmjs.com/package/fabric-shim-crypto)
8+
[![Rocket.Chat](https://chat.hyperledger.org/images/join-chat.svg)](https://chat.hyperledger.org/channel/fabric-chaincode-dev)
49

5-
As an application developer, to learn about how to implement **"Smart Contracts"** for Hyperledger Fabric using Node.js, please visit the [API documentation](https://fabric-shim.github.io/) - and follow the tutorial links. A [quick-start tutorial](TUTORIAL.md) is in this repo.
10+
This is the project to support the writing of Contracts with the node.js runtime.
611

712
As a contributor looking to update this repo, please start with the [contributing guide](CONTRIBUTING.md)
813

14+
## Documentation
15+
16+
As an application developer, to learn about how to implement **"Smart Contracts"** for Hyperledger Fabric using Node.js, please visit the [API documentation](https://hyperledger.github.io/fabric-chaincode-node/) and follow the tutorial links.
17+
18+
- [API documentation](https://hyperledger.github.io/fabric-chaincode-node/)
19+
- [Full Documenation on Hyperledger Fabric](https://hyperledger-fabric.readthedocs.io/)
20+
- [Samples repository](https://github.com/hyperledger/fabric-samples)
21+
- [Quick-start tutorial](TUTORIAL.md)
22+
923
## Artifacts published from this repo
1024

1125
- npm modules
12-
- [fabric-chaincode-shim](https://www.npmjs.com/package/fabric-chaincode-shim)
1326
- [fabric-contract-api](https://www.npmjs.com/package/fabric-contract-api)
27+
- [fabric-shim](https://www.npmjs.com/package/fabric-shim)
1428
- [fabric-shim-api](https://www.npmjs.com/package/fabric-shim-api)
1529
- [fabric-shim-crypto](https://www.npmjs.com/package/fabric-shim-crypto)
1630
- docker images
1731
- [fabric-nodeenv](https://hub.docker.com/r/hyperledger/fabric-nodeenv)
18-
- api documentation
19-
- [API docs](https://fabric-shim.github.io/)
20-
21-
## Where to go from here?
22-
23-
- [API documentation](https://fabric-shim.github.io/)
24-
- [Full Documenation on Hyperledger Fabric](https://hyperledger-fabric.readthedocs.io/en/release-1.4/)
25-
- [Samples repository](https://github.com/hyperledger/fabric-samples)
2632

2733
---
2834

ci/azure-pipelines.yml

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ stages:
9999
inputs:
100100
pathToPublish: $(Build.ArtifactStagingDirectory)/logs
101101
artifactName: 'Build logs'
102-
- task: PublishBuildArtifacts@1
103-
condition: or(succeeded(), failed()) # publish either way
104-
inputs:
105-
pathToPublish: docs/apidocs/_out
106-
artifactName: 'JS API Doc'
107102

108103
# Copy the built artifacts to the staging directory, tgz, and the docker image
109104
- script: |
@@ -200,6 +195,61 @@ stages:
200195
npm audit
201196
displayName: 'Run npm audit'
202197
198+
# Build and publish API docs on every merge build
199+
- job: jsdoc
200+
condition: and(succeeded(),eq(variables['Build.Reason'], 'IndividualCI'))
201+
steps:
202+
- script: |
203+
set -ev
204+
node common/scripts/install-run-rush.js install
205+
displayName: 'Setup the rush environment'
206+
- script: |
207+
set -ev
208+
node common/scripts/install-run-rush.js rebuild --to fabric-shim-docs
209+
displayName: 'Build JSDoc'
210+
- task: CopyFiles@2
211+
inputs:
212+
contents: |
213+
gen/**
214+
sourceFolder: '$(Build.SourcesDirectory)/docs'
215+
targetFolder: $(Build.ArtifactStagingDirectory)/jsdoc
216+
cleanTargetFolder: true
217+
displayName: 'Copy jsdoc'
218+
- task: CopyFiles@2
219+
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
220+
inputs:
221+
contents: |
222+
_config.yml
223+
**/?(*.md|*.html)
224+
!_jsdoc.json
225+
!_jsdoc/**
226+
sourceFolder: '$(Build.SourcesDirectory)/docs'
227+
targetFolder: $(Build.ArtifactStagingDirectory)/gh-pages
228+
cleanTargetFolder: true
229+
displayName: 'Copy gh-pages doc (master branch only)'
230+
- script: |
231+
git reset --hard HEAD
232+
git clean -xdf
233+
git fetch origin
234+
git checkout -b gh-pages origin/gh-pages
235+
git clean -xdf
236+
237+
mkdir -p $(Build.SourceBranchName)/api
238+
rm -rf $(Build.SourceBranchName)/api/*
239+
cp -r $(Build.ArtifactStagingDirectory)/jsdoc/* $(Build.SourceBranchName)/api
240+
if [ -d $(Build.ArtifactStagingDirectory)/gh-pages ]; then
241+
find . -maxdepth 1 ! \( -name [.]* -o -name 'gh-pages' -o -name 'master' -o -name 'release-*' \) -exec rm -rf {} \;
242+
cp -r $(Build.ArtifactStagingDirectory)/gh-pages/* .
243+
fi
244+
displayName: 'Update gh-pages branch'
245+
- script: |
246+
git config --global user.email "hlfdev.azp@gmail.com"
247+
git config --global user.name "Hyperledger Bot"
248+
git add -A
249+
git commit -m "Publishing GitHub Pages"
250+
git push https://$(GITHUB-PAT)@github.com/hyperledger/fabric-chaincode-java.git gh-pages
251+
displayName: 'Commit gh-pages changes'
252+
203253
# Publish a new version, triggered by a git tag
204254
- stage: Publish_tag
205255
dependsOn: Build_and_Test

0 commit comments

Comments
 (0)