Skip to content

Commit

Permalink
[FABCI-482] Update Nexus URL's to Artifactory
Browse files Browse the repository at this point in the history
Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
  • Loading branch information
Brett Logan authored and mbwhite committed Jan 16, 2020
1 parent b296d0a commit 869f107
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 65 deletions.
21 changes: 2 additions & 19 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,6 @@ stages:
npm audit
displayName: 'Run npm audit'
# Publish the snapshot images
- job: snapshot_publish
condition: and(succeeded(),eq(variables['Build.Reason'], 'IndividualCI'))
dependsOn: fvt
steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: nodeenv-docker-image
path: $(Build.SourcesDirectory)/build
- script: ./ci/scripts/publish_docker.sh
env:
NEXUS_USERNAME: $(nexus-user)
NEXUS_PASSWORD: $(nexus-password)
NEXUS_URL: nexus3.hyperledger.org:10003/hyperledger
displayName: 'docker push to nexus'

# Publish a new version, triggered by a git tag
- stage: Publish_tag
dependsOn: Build_and_Test
Expand Down Expand Up @@ -257,14 +241,13 @@ stages:
inputs:
artifact: nodeenv-docker-image
path: $(Build.SourcesDirectory)/build

- script: |
wget -qO "$PWD/manifest-tool" https://github.com/estesp/manifest-tool/releases/download/v1.0.0/manifest-tool-linux-amd64
chmod +x ./manifest-tool
docker image load --input build/fabric-nodeenv.tar.gz
docker images
# Publish docker images to nexus repository
docker login ${DOCKER_REGISTRY_URL} --username=${DOCKER_REGISTRY_USERNAME} --password=${DOCKER_REGISTRY_PASSWORD}
echo "Logged in to docker registry"
# tag nodeenv image to PACKAGE_VERSION
Expand All @@ -275,4 +258,4 @@ stages:
./manifest-tool push from-args --platforms linux/amd64 --template "hyperledger/fabric-nodeenv:amd64-$(BuildData.PACKAGE_VERSION)-beta" --target "hyperledger/fabric-nodeenv:2.0"
env:
DOCKER_REGISTRY_USERNAME: $(DockerHub-Username)
DOCKER_REGISTRY_PASSWORD: $(DockerHub-Password)
DOCKER_REGISTRY_PASSWORD: $(DockerHub-Password)
12 changes: 0 additions & 12 deletions ci/scripts/publish_docker.sh

This file was deleted.

50 changes: 16 additions & 34 deletions tools/getEdgeDocker.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash -e
set -o pipefail
set -euo pipefail

echo "======== PULL DOCKER IMAGES ========"

##########################################################
# Pull and Tag the fabric and fabric-ca images from Nexus
##########################################################
echo "Fetching images from Nexus"
NEXUS_URL=nexus3.hyperledger.org:10001
ORG_NAME="hyperledger/fabric"
###############################################################
# Pull and Tag the fabric and fabric-ca images from Artifactory
###############################################################
echo "Fetching images from Artifactory"
ARTIFACTORY_URL=hyperledger-fabric.jfrog.io
ORG_NAME="hyperledger"

VERSION=2.0.0
ARCH="amd64"
Expand All @@ -25,39 +25,21 @@ dockerTag() {
for IMAGES in peer orderer ca ca orderer baseos ccenv tools; do
echo "Images: $IMAGES"
echo
docker pull $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG
if [ $? != 0 ]; then
docker pull $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG
if [[ $? != 0 ]]; then
echo "FAILED: Docker Pull Failed on $IMAGES"
exit 1
fi
docker tag $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG $ORG_NAME-$IMAGES
docker tag $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG $ORG_NAME-$IMAGES:$MASTER_TAG
echo "$ORG_NAME-$IMAGES:$MASTER_TAG"
echo "Deleting Nexus docker images: $IMAGES"
docker rmi -f $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG
done
}

dockerTag2() {
for IMAGES in baseos ccenv; do
echo "Images: $IMAGES"
echo
docker pull $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG
if [ $? != 0 ]; then
echo "FAILED: Docker Pull Failed on $IMAGES"
exit 1
fi
docker tag $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG $ORG_NAME-$IMAGES
docker tag $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG $ORG_NAME-$IMAGES:$VERSION
echo "$ORG_NAME-$IMAGES:$VERSION"
echo "Deleting Nexus docker images: $IMAGES"
docker rmi -f $NEXUS_URL/$ORG_NAME-$IMAGES:$STABLE_TAG
docker tag $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG $ORG_NAME/fabric-$IMAGES
docker tag $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG $ORG_NAME/fabric-$IMAGES:$MASTER_TAG
echo "$ORG_NAME/fabric-$IMAGES:$MASTER_TAG"
echo "Deleting Artifcatory docker images: $IMAGES"
docker rmi -f $ARTIFACTORY_URL/fabric-$IMAGES:$STABLE_TAG
done
}

dockerTag
dockerTag2

echo
docker images | grep "hyperledger*"
echo
docker images | grep "hyperledger"
echo

0 comments on commit 869f107

Please sign in to comment.