Skip to content

Commit

Permalink
FAB-13305 Update scripts to pull latest artifacts
Browse files Browse the repository at this point in the history
Update byfn/eyfn Jenkins script to get the latest
version binaries for fabric and fabric-ca

Change-Id: I0a310385285b1c086a6cfef0f7cb1c1906ed8351
Signed-off-by: Sambhav Nidamarty <sambhavdutt@gmail.com>
  • Loading branch information
sambhavdutt committed Dec 17, 2018
1 parent ab46e35 commit c7572aa
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions scripts/Jenkins_Scripts/byfn_eyfn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,36 @@
# docker container list
CONTAINER_LIST=(peer0.org1 peer1.org1 peer0.org2 peer1.org2 peer0.org3 peer1.org3 orderer)
COUCHDB_CONTAINER_LIST=(couchdb0 couchdb1 couchdb2 couchdb3 couchdb4 couchdb5)

MARCH=$(uname -s|tr '[:upper:]' '[:lower:]')
echo "-----------> MARCH" $MARCH
echo "-----------> PROJECT_VERSION:" $PROJECT_VERSION
# Download latest binaries from nexus2
MVN_METADATA=$(echo "https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric-$PROJECT_VERSION/maven-metadata.xml")
curl -L "$MVN_METADATA" > maven-metadata.xml
RELEASE_TAG=$(cat maven-metadata.xml | grep release)
COMMIT=$(echo $RELEASE_TAG | awk -F - '{ print $4 }' | cut -d "<" -f1)
echo "-----------> COMMIT = $COMMIT"
cd $BASE_FOLDER/fabric-samples || exit
curl https://nexus.hyperledger.org/content/repositories/releases/org/hyperledger/fabric/hyperledger-fabric-$PROJECT_VERSION/$MARCH-$ARCH.$PROJECT_VERSION-$COMMIT/hyperledger-fabric-$PROJECT_VERSION-$MARCH-$ARCH.$PROJECT_VERSION-$COMMIT.tar.gz | tar xz

if [ $? -ne 0 ]; then
echo -e "\033[31m FAILED to download binaries" "\033[0m"
exit 1
MARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}')
echo "MARCH: $MARCH"
echo "======== PULL fabric BINARIES ========"
echo
# Set Nexus Snapshot URL
NEXUS_URL=https://nexus.hyperledger.org/content/repositories/snapshots/org/hyperledger/fabric/hyperledger-fabric-latest/$MARCH.latest-SNAPSHOT

# Download the maven-metadata.xml file
curl $NEXUS_URL/maven-metadata.xml > maven-metadata.xml
if grep -q "not found in local storage of repository" "maven-metadata.xml"; then
echo "FAILED: Unable to download from $NEXUS_URL"
else
# Set latest tar file to the VERSION
VERSION=$(grep value maven-metadata.xml | sort -u | cut -d "<" -f2|cut -d ">" -f2)
# Download tar.gz file and extract it
cd $BASE_FOLDER/fabric-samples || exit
mkdir -p $BASE_FOLDER/fabric-samples/bin
curl $NEXUS_URL/hyperledger-fabric-latest-$VERSION.tar.gz | tar xz
if [ $? -ne 0 ]; then
echo -e "\033[31m FAILED to download binaries" "\033[0m"
exit 1
fi
rm hyperledger-fabric-*.tar.gz
rm -f maven-metadata.xml
echo "Finished pulling fabric binaries..."
echo
fi

cd first-network || exit
export PATH=gopath/src/github.com/hyperledger/fabric-samples/bin:$PATH
cd $BASE_FOLDER/fabric-samples/first-network || exit
export PATH=$BASE_FOLDER/fabric-samples/bin:$PATH

logs() {

Expand Down

0 comments on commit c7572aa

Please sign in to comment.