diff --git a/.gitignore b/.gitignore index 006d7716d3..771eaaf5b6 100644 --- a/.gitignore +++ b/.gitignore @@ -60,9 +60,6 @@ packages/composer-systests/systestv1/tls/ca/fabric-ca-server.db packages/composer-runtime-hlfv1/vendor/github.com/ packages/composer-runtime-hlfv1/vendor/gopkg.in/sourcemap.v1/ -packages/composer-website/installers/fabric-dev-servers.zip -packages/composer-website/installers/hlfv*/fabric-dev-servers/ - packages/composer-playground/e2e/downloads/ package-lock.json diff --git a/.travis/script.sh b/.travis/script.sh index 4e2cbb8d59..527b98df12 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -23,9 +23,6 @@ if [ "${DOCS}" != "" ]; then # Change into the docs directory. cd "${DIR}/packages/composer-website" - # Build the installers. - ./build-installers.sh - # Build the documentation. npm run doc diff --git a/packages/composer-website/.gitignore b/packages/composer-website/.gitignore index a892d5f88b..dcb86252e8 100644 --- a/packages/composer-website/.gitignore +++ b/packages/composer-website/.gitignore @@ -48,7 +48,6 @@ out *.swp # Ignore temporary built installers. -installers/*/install.sh jekylldocs/install*.sh jsondata/** jekylldocs/api/**/* diff --git a/packages/composer-website/build-installers.sh b/packages/composer-website/build-installers.sh deleted file mode 100755 index c19e7a75db..0000000000 --- a/packages/composer-website/build-installers.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Exit on first error, print all commands. -set -ev - -# Grab the directory containing this script. -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# get the current release version -RELEASE_VER="$(cat ${DIR}/package.json | grep version | sed 's/\"//g; s/,//g;' | cut -d: -f2)" -echo $RELEASE_VER - -cd "${DIR}/installers" - - -# Get the fabric tools -curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.zip - -# Build all of the installers. - - -VERSION=hlfv1 -unzip -q fabric-dev-servers.zip -d $VERSION/fabric-dev-servers/ -$VERSION/build.sh ${RELEASE_VER} -cp -f $VERSION/install.sh ../jekylldocs/install-$VERSION.sh -cp -f $VERSION/install-unstable.sh ../jekylldocs/install-$VERSION-unstable.sh - -rm -rf $VERSION/fabric-dev-servers/ - -# clean up -rm fabric-dev-servers.zip diff --git a/packages/composer-website/installers/hlfv1/build.sh b/packages/composer-website/installers/hlfv1/build.sh deleted file mode 100755 index 6180171820..0000000000 --- a/packages/composer-website/installers/hlfv1/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -ev -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd "${DIR}" - -RELEASE_VER=$1 -echo building for ${RELEASE_VER} - -# build the latest version of the installer - note the release version is the param to this script -cat install.sh.in | sed 's/{{ENV}}//g' | sed "s/{{ENV_VER}}/${RELEASE_VER}/g" > install.sh -echo "PAYLOAD:" >> install.sh -tar czf - docker-compose-playground.yml fabric-dev-servers >> install.sh - -# build the unstable installer -cat install.sh.in | sed 's/{{ENV}}/-unstable/g' | sed 's/{{ENV_VER}}/unstable/g' > install-unstable.sh -echo "PAYLOAD:" >> install-unstable.sh -tar czf - docker-compose-playground.yml fabric-dev-servers >> install-unstable.sh diff --git a/packages/composer-website/installers/hlfv1/docker-compose-playground.yml b/packages/composer-website/installers/hlfv1/docker-compose-playground.yml deleted file mode 100644 index d854cc295f..0000000000 --- a/packages/composer-website/installers/hlfv1/docker-compose-playground.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '2' - -services: - - composer: - container_name: composer - image: hyperledger/composer-playground - ports: - - '8080:8080' -networks: - default: - external: - name: composer_default diff --git a/packages/composer-website/installers/hlfv1/install-unstable.sh b/packages/composer-website/installers/hlfv1/install-unstable.sh deleted file mode 100755 index 478bf6b483..0000000000 Binary files a/packages/composer-website/installers/hlfv1/install-unstable.sh and /dev/null differ diff --git a/packages/composer-website/installers/hlfv1/install.sh.in b/packages/composer-website/installers/hlfv1/install.sh.in deleted file mode 100755 index 3f2a043584..0000000000 --- a/packages/composer-website/installers/hlfv1/install.sh.in +++ /dev/null @@ -1,149 +0,0 @@ -ME=`basename "$0"` -if [ "${ME}" = "install-hlfv1{{ENV}}.sh" ]; then - echo "Please re-run as > cat install-hlfv1{{ENV}}.sh | bash" - exit 1 -fi -(cat > composer.sh; chmod +x composer.sh; exec bash composer.sh) -#!/bin/bash -set -e - -# Docker stop function -function stop() -{ -P1=$(docker ps -q) -if [ "${P1}" != "" ]; then - echo "Killing all running containers" &2> /dev/null - docker kill ${P1} -fi - -P2=$(docker ps -aq) -if [ "${P2}" != "" ]; then - echo "Removing all containers" &2> /dev/null - docker rm ${P2} -f -fi -} - -if [ "$1" == "stop" ]; then - echo "Stopping all Docker containers" >&2 - stop - exit 0 -fi - -# Get the current directory. -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -# Get the full path to this script. -SOURCE="${DIR}/composer.sh" - -# Create a work directory for extracting files into. -WORKDIR="$(pwd)/composer-data{{ENV}}" -rm -rf "${WORKDIR}" && mkdir -p "${WORKDIR}" -cd "${WORKDIR}" - -# Find the PAYLOAD: marker in this script. -PAYLOAD_LINE=$(grep -a -n '^PAYLOAD:$' "${SOURCE}" | cut -d ':' -f 1) -echo PAYLOAD_LINE=${PAYLOAD_LINE} - -# Find and extract the payload in this script. -PAYLOAD_START=$((PAYLOAD_LINE + 1)) -echo PAYLOAD_START=${PAYLOAD_START} -tail -n +${PAYLOAD_START} "${SOURCE}" | tar -xzf - - -# stop all the docker containers -stop - - - -# run the fabric-dev-scripts to get a running fabric -export FABRIC_VERSION=hlfv11 -./fabric-dev-servers/downloadFabric.sh -./fabric-dev-servers/startFabric.sh - -# pull and tage the correct image for the installer -docker pull hyperledger/composer-playground:{{ENV_VER}} -docker tag hyperledger/composer-playground:{{ENV_VER}} hyperledger/composer-playground:latest - -# Start all composer -docker-compose -p composer -f docker-compose-playground.yml up -d - -# manually create the card store -docker exec composer mkdir /home/composer/.composer - -# build the card store locally first -rm -fr /tmp/onelinecard -mkdir /tmp/onelinecard -mkdir /tmp/onelinecard/cards -mkdir /tmp/onelinecard/client-data -mkdir /tmp/onelinecard/cards/PeerAdmin@hlfv1 -mkdir /tmp/onelinecard/client-data/PeerAdmin@hlfv1 -mkdir /tmp/onelinecard/cards/PeerAdmin@hlfv1/credentials - -# copy the various material into the local card store -cd fabric-dev-servers/fabric-scripts/hlfv11/composer -cp creds/* /tmp/onelinecard/client-data/PeerAdmin@hlfv1 -cp crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem /tmp/onelinecard/cards/PeerAdmin@hlfv1/credentials/certificate -cp crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk /tmp/onelinecard/cards/PeerAdmin@hlfv1/credentials/privateKey -echo '{"version":1,"userName":"PeerAdmin","roles":["PeerAdmin", "ChannelAdmin"]}' > /tmp/onelinecard/cards/PeerAdmin@hlfv1/metadata.json -echo '{ - "type": "hlfv1", - "name": "hlfv1", - "orderers": [ - { "url" : "grpc://orderer.example.com:7050" } - ], - "ca": { "url": "http://ca.org1.example.com:7054", - "name": "ca.org1.example.com" - }, - "peers": [ - { - "requestURL": "grpc://peer0.org1.example.com:7051", - "eventURL": "grpc://peer0.org1.example.com:7053" - } - ], - "channel": "composerchannel", - "mspID": "Org1MSP", - "timeout": 300 -}' > /tmp/onelinecard/cards/PeerAdmin@hlfv1/connection.json - -# transfer the local card store into the container -cd /tmp/onelinecard -tar -cv * | docker exec -i composer tar x -C /home/composer/.composer -rm -fr /tmp/onelinecard - -cd "${WORKDIR}" - -# Wait for playground to start -sleep 5 - -# Kill and remove any running Docker containers. -##docker-compose -p composer kill -##docker-compose -p composer down --remove-orphans - -# Kill any other Docker containers. -##docker ps -aq | xargs docker rm -f - -# Open the playground in a web browser. -case "$(uname)" in -"Darwin") open http://localhost:8080 - ;; -"Linux") if [ -n "$BROWSER" ] ; then - $BROWSER http://localhost:8080 - elif which xdg-open > /dev/null ; then - xdg-open http://localhost:8080 - elif which gnome-open > /dev/null ; then - gnome-open http://localhost:8080 - #elif other types blah blah - else - echo "Could not detect web browser to use - please launch Composer Playground URL using your chosen browser ie: http://localhost:8080 or set your BROWSER variable to the browser launcher in your PATH" - fi - ;; -*) echo "Playground not launched - this OS is currently not supported " - ;; -esac - -echo -echo "--------------------------------------------------------------------------------------" -echo "Hyperledger Fabric and Hyperledger Composer installed, and Composer Playground launched" -echo "Please use 'composer.sh' to re-start, and 'composer.sh stop' to shutdown all the Fabric and Composer docker images" - -# Exit; this is required as the payload immediately follows. -exit 0