|
4 | 4 | # |
5 | 5 | # fabric-chaincode-java azure pipeline configuration. |
6 | 6 | # |
7 | | -name: RELEASE-$(Date:yyyyMMdd)$(Rev:.rrr) |
| 7 | +name: $(BUILD_SOURCEBRANCHNAME)-$(Date:yyyyMMdd)$(Rev:.rrr) |
8 | 8 |
|
9 | 9 | # Daily build for final quality |
10 | 10 | # cf https://crontab.guru/#0_23_*_*_* |
@@ -42,6 +42,10 @@ variables: |
42 | 42 | value: fabric-chaincode-java |
43 | 43 | - name: pipeline |
44 | 44 | value: ci |
| 45 | + - name: NEXUS_REPO_URL |
| 46 | + value: nexus3.hyperledger.org:10002 |
| 47 | + - name: PUSH_VERSION |
| 48 | + value: stable |
45 | 49 |
|
46 | 50 | pool: |
47 | 51 | vmImage: 'ubuntu-latest' |
@@ -69,6 +73,26 @@ stages: |
69 | 73 | - task: PublishCodeCoverageResults@1 |
70 | 74 | inputs: |
71 | 75 | summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/fabric-chaincode-shim/build/reports/jacoco/test/jacocoTestReport.xml' |
| 76 | + |
| 77 | +# Publish to Nexus the snapshot images etc. |
| 78 | +# Original source of these is https://github.com/hyperledger/ci-management/blob/master/jjb/fabric-chaincode-java/shell/include-raw-publish-docker-jar.sh |
| 79 | + - job: snapshot_nexus |
| 80 | + condition: and(succeeded(),eq(variables['Build.Reason'], 'IndividualCI')) |
| 81 | + steps: |
| 82 | + - script: | |
| 83 | + # Publish docker images to nexus repository |
| 84 | + docker login nexus3.hyperledger.org:10001 --username=$(NEXUS_HUB_USERNAME) --password=$(NEXUS_HUB_PASSWORD) |
| 85 | + # tag javaenv image to $PUSH_VERSION |
| 86 | + docker tag hyperledger/fabric-javaenv $(NEXUS_REPO_URL)/hyperledger/fabric-javaenv:amd64-$(PUSH_VERSION) |
| 87 | + # push javaenv to nexus repository |
| 88 | + docker push $(NEXUS_REPO_URL)/hyperledger/fabric-javaenv:amd64-$(PUSH_VERSION) |
| 89 | + - script: | |
| 90 | + ./gradlew publishToMavenLocal |
| 91 | + # |
| 92 | + export PUSH_VERSION=$(PUSH_VERSION) |
| 93 | + # |
| 94 | + ./ci/publish_jar_nexus.sh |
| 95 | +
|
72 | 96 | - stage: Publish_tag |
73 | 97 | condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags')) |
74 | 98 | jobs: |
|
0 commit comments