Skip to content

Commit 5618de6

Browse files
mbwhitejt-nti
authored andcommitted
Push the snapshot docker images to nexus
Change-Id: Ifa1d1297f0c0051d9ec7ff788611a1ce44b9e098 Signed-off-by: Matthew B. White <[email protected]>
1 parent 5a11c6e commit 5618de6

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

ci/azure-pipelines.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# fabric-chaincode-java azure pipeline configuration.
66
#
7-
name: $(BUILD_SOURCEBRANCHNAME)-$(Date:yyyyMMdd)$(Rev:.rrr)
7+
name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rrr)
88

99
# Daily build for final quality
1010
# cf https://crontab.guru/#0_23_*_*_*
@@ -43,7 +43,7 @@ variables:
4343
- name: pipeline
4444
value: ci
4545
- name: NEXUS_REPO_URL
46-
value: nexus3.hyperledger.org:10002
46+
value: nexus3.hyperledger.org:10003
4747
- name: PUSH_VERSION
4848
value: stable
4949

@@ -81,18 +81,25 @@ stages:
8181
steps:
8282
- script: |
8383
# Publish docker images to nexus repository
84-
docker login nexus3.hyperledger.org:10001 --username=$(NEXUS_HUB_USERNAME) --password=$(NEXUS_HUB_PASSWORD)
84+
docker login $(NEXUS_REPO_URL) --username=$env.NEXUS_HUB_USERNAME --password=$env.NEXUS_HUB_PASSWORD
8585
# tag javaenv image to $PUSH_VERSION
8686
docker tag hyperledger/fabric-javaenv $(NEXUS_REPO_URL)/hyperledger/fabric-javaenv:amd64-$(PUSH_VERSION)
8787
# push javaenv to nexus repository
8888
docker push $(NEXUS_REPO_URL)/hyperledger/fabric-javaenv:amd64-$(PUSH_VERSION)
89+
env:
90+
NEXUS_HUB_USERNAME: $(nexus-user)
91+
NEXUS_HUB_PASSWORD: $(nexus-password)
8992
- script: |
9093
./gradlew publishToMavenLocal
91-
#
92-
export PUSH_VERSION=$(PUSH_VERSION)
93-
#
94-
./ci/publish_jar_nexus.sh
94+
# As the next script is more complex and uses loops, run this descretely in a sh file
95+
- task: Bash@3
96+
inputs:
97+
targetType: 'filePath'
98+
filePath: '/ci/publish_jar_nexus.sh'
99+
env:
100+
PUSH_VERSION: $(PUSH_VERSION)
95101

102+
# Publishing step for git tags
96103
- stage: Publish_tag
97104
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
98105
jobs:

ci/publish_jar_nexus.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function abort {
1717
for binary in shim protos; do
1818
echo "Pushing fabric-chaincode-$binary.$PUSH_VERSION.jar to maven releases.."
1919
cp $WORKSPACE/fabric-chaincode-$binary/build/libs/fabric-chaincode-$binary-$PUSH_VERSION.jar $WORKSPACE/fabric-chaincode-$binary/build/libs/fabric-chaincode-$binary.$PUSH_VERSION.jar
20-
mwn org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
20+
mvn org.apache.maven.plugins:maven-deploy-plugin:deploy-file \
2121
-DupdateReleaseInfo=true \
2222
-Dfile=$WORKSPACE/fabric-chaincode-$binary/build/libs/fabric-chaincode-$binary.$PUSH_VERSION.jar \
2323
-DpomFile=$WORKSPACE/fabric-chaincode-$binary/build/publications/"$binary"Jar/pom-default.xml \

0 commit comments

Comments
 (0)