Skip to content

Commit 831001f

Browse files
committed
[FABCJ-283] Update docs to handle new branch
Signed-off-by: James Taylor <jamest@uk.ibm.com> # Conflicts: # ci/azure-pipelines.yml
1 parent 61043ff commit 831001f

File tree

3 files changed

+32
-23
lines changed

3 files changed

+32
-23
lines changed

ci/azure-pipelines.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ pool:
5050
stages:
5151
- stage: Build_and_test
5252
jobs:
53-
- job: main
54-
steps:
53+
- job: displayenv
54+
steps:
5555
- template: templates/build-data.yml
56+
- job: main
57+
steps:
5658
- task: Gradle@2
5759
inputs:
5860
workingDirectory: ""
@@ -117,7 +119,13 @@ stages:
117119
artifactName: javaenv-docker-image
118120

119121
- job: javadoc
122+
dependsOn: displayenv
120123
condition: and(succeeded(),eq(variables['Build.Reason'], 'IndividualCI'))
124+
variables:
125+
${{ if eq(variables['Build.SourceBranch'], 'refs/heads/master') }}:
126+
javadoc_release: master
127+
${{ if ne(variables['Build.SourceBranch'], 'refs/heads/master') }}:
128+
javadoc_release: release-$(BuildData.MINOR_PACKAGE_VERSION)
121129
steps:
122130
- script: ./gradlew javadoc
123131
displayName: 'Build JavaDoc'
@@ -131,9 +139,9 @@ stages:
131139
- script: |
132140
git fetch origin
133141
git checkout -b gh-pages origin/gh-pages
134-
mkdir -p $(Build.SourceBranchName)/api
135-
rm -rf $(Build.SourceBranchName)/api/*
136-
cp -r fabric-chaincode-shim/build/docs/javadoc/* $(Build.SourceBranchName)/api
142+
mkdir -p $(javadoc_release)/api
143+
rm -rf $(javadoc_release)/api/*
144+
cp -r fabric-chaincode-shim/build/docs/javadoc/* $(javadoc_release)/api
137145
138146
# if the gh-pages is present from the previous script, then copy across the files across.
139147
if [ -d gh-pages ]; then

ci/templates/build-data.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ steps:
22
- script: |
33
env | sort
44
java -version
5+
# handle full version number
56
VERSION=$(./gradlew -q printVersionName | head -n 1 | cut -d'-' -f1)
67
VERSION=${VERSION// }
78
echo Current version in code is :${VERSION}:
89
echo "##vso[task.setvariable variable=PACKAGE_VERSION;isOutput=true]${VERSION}"
10+
# handle minor version
11+
MINOR_VERSION=$(echo $VERSION | sed 's/^\([0-9]\{1,\}\.[0-9]\{1,\}\)\..*/\1/')
12+
MINOR_VERSION=${MINOR_VERSION// }
13+
echo Current minor version in code is :${MINOR_VERSION}:
14+
echo "##vso[task.setvariable variable=MINOR_PACKAGE_VERSION;isOutput=true]${MINOR_VERSION}"
915
name: BuildData
1016
displayName: 'Build data'

docs/_includes/header.html

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,19 @@
33
<div class="wrapper">
44
<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
55

6-
{%- assign num_releases = site.releases | size -%}
7-
{%- if num_releases > 0 -%}
8-
<nav class="site-nav">
9-
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
10-
<label for="nav-trigger">
11-
<span class="menu-icon">
12-
<svg viewBox="0 0 18 15" width="18px" height="15px">
13-
<path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
14-
</svg>
15-
</span>
16-
</label>
6+
<nav class="site-nav">
7+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
8+
<label for="nav-trigger">
9+
<span class="menu-icon">
10+
<svg viewBox="0 0 18 15" width="18px" height="15px">
11+
<path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.695,18,13.516L18,13.516z"/>
12+
</svg>
13+
</span>
14+
</label>
1715

18-
<div class="trigger">
19-
{%- for release in site.releases -%}
20-
<a class="page-link" href="https://github.com/hyperledger/fabric-chaincode-java/tree/{{ release }}">{{ release | escape }}</a>
21-
{%- endfor -%}
22-
</div>
23-
</nav>
24-
{%- endif -%}
16+
<div class="trigger">
17+
<a class="page-link" href="https://github.com/hyperledger/fabric-chaincode-java/">View on GitHub</a>
18+
</div>
19+
</nav>
2520
</div>
2621
</header>

0 commit comments

Comments
 (0)