github.com/kchristidis/fabric@v1.0.4-0.20171028114726-837acd08cde1/test/regression/release/run_make_targets.sh (about)

     1  #!/bin/bash
     2  
     3  #
     4  # Copyright IBM Corp. All Rights Reserved.
     5  #
     6  # SPDX-License-Identifier: Apache-2.0
     7  #
     8  
     9  set -o pipefail
    10  
    11  CWD=$GOPATH/src/github.com/hyperledger/fabric
    12  cd $CWD
    13  
    14  VERSION=`cat Makefile | grep BASE_VERSION | awk '{print $3}' | head -n1`
    15  echo "===>Release_VERSION: $VERSION"
    16  
    17  makeCleanAll() {
    18  
    19    make clean-all
    20    echo "clean-all from fabric repository"
    21   }
    22  
    23  # make native
    24  makeNative() {
    25  
    26    make native
    27    for binary in chaintool configtxgen configtxlator cryptogen orderer peer; do
    28    	if [ ! -f $CWD/build/bin/$binary ] ; then
    29       	   echo " ====> ERROR !!! $binary is not available"
    30       	   echo
    31             exit 1
    32          fi
    33  
    34             echo " ====> PASS !!! $binary is available"
    35    done
    36  }
    37  
    38  # Build peer, orderer, configtxgen, cryptogen and configtxlator
    39  makeBinary() {
    40  
    41     make clean-all
    42     make peer && make orderer && make configtxgen && make cryptogen && make configtxlator
    43     for binary in peer orderer configtxgen cryptogen configtxlator; do
    44           if [ ! -f $CWD/build/bin/$binary ] ; then
    45       	   echo " ====> ERROR !!! $binary is not available"
    46       	   echo
    47             exit 1
    48          fi
    49  
    50             echo " ====> PASS !!! $binary is available"
    51     done
    52  }
    53  
    54  # Create tar files for each platform
    55  makeDistAll() {
    56  
    57     make clean-all
    58     make dist-all
    59     for dist in linux-amd64 windows-amd64 darwin-amd64 linux-ppc64le linux-s390x; do
    60          if [ ! -d $CWD/release/$dist ] ; then
    61       	   echo " ====> ERROR !!! $dist is not available"
    62       	   echo
    63             exit 1
    64          fi
    65  
    66             echo " ====> PASS !!! $dist is available"
    67  done
    68  }
    69  
    70  # Create docker images
    71  makeDocker() {
    72      make docker-clean
    73      make docker
    74          if [ $? -ne 0 ] ; then
    75             echo " ===> ERROR !!! Docker Images are not available"
    76             echo
    77             exit 1
    78          fi
    79             echo " ===> PASS !!! Docker Images are available"
    80  }
    81  
    82  # Verify the version built in peer and configtxgen binaries
    83  makeVersion() {
    84      make docker-clean
    85      make release
    86      cd release/linux-amd64/bin
    87      ./peer --version > peer.txt
    88      Pversion=$(grep -v "2017" peer.txt | grep Version: | awk '{print $2}' | head -n1)
    89          if [ "$Pversion" != "$VERSION" ]; then
    90             echo " ===> ERROR !!! Peer Version check failed"
    91             echo
    92          fi
    93     ./configtxgen --version > configtxgen.txt
    94     Configtxgen=$(grep -v "2017" configtxgen.txt | grep Version: | awk '{print $2}' | head -n1)
    95          if [ "$Configtxgen" != "$VERSION" ]; then
    96             echo "====> ERROR !!! configtxgen Version check failed:"
    97             echo
    98             exit 1
    99          fi
   100             echo "====> PASS !!! Configtxgen version verified:"
   101  }
   102  
   103  $1