diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 1ac8aa79..f68f8777 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -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 @@ -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 @@ -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) \ No newline at end of file + DOCKER_REGISTRY_PASSWORD: $(DockerHub-Password) diff --git a/ci/scripts/publish_docker.sh b/ci/scripts/publish_docker.sh deleted file mode 100755 index 5e5c2cb4..00000000 --- a/ci/scripts/publish_docker.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# Copyright IBM Corp. All Rights Reserved. -# -# SPDX-License-Identifier: Apache-2.0 -set -euo pipefail - -docker image load --input build/fabric-nodeenv.tar.gz # gets the build image of nodeenv -docker images - -docker login nexus3.hyperledger.org:10003 --username="${NEXUS_USERNAME}" --password="${NEXUS_PASSWORD}" -docker tag hyperledger/fabric-nodeenv "${NEXUS_URL}/fabric-nodeenv:amd64-2.0.0-beta" -docker push "${NEXUS_URL}/fabric-nodeenv:amd64-2.0.0-beta" diff --git a/tools/getEdgeDocker.sh b/tools/getEdgeDocker.sh index faf20241..6e30d499 100755 --- a/tools/getEdgeDocker.sh +++ b/tools/getEdgeDocker.sh @@ -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" @@ -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 \ No newline at end of file +docker images | grep "hyperledger" +echo