From b3f82a175c1e3e721a91b52f2f2fd98ff73f5fc2 Mon Sep 17 00:00:00 2001 From: Cam Parra Date: Fri, 31 Aug 2018 14:01:39 -0600 Subject: [PATCH] Build pool fixes (#136) * changes to dockerfile * correction to gitignore Signed-off-by: Cam Parra * docker backup removed Signed-off-by: Cam Parra * UPDATE on deps * added comments --- .gitignore | 2 +- build_indy_pool | 37 +++++-------------- .../xenial/Pool_Party/Dockerfile | 9 +++-- devops/build-scripts/xenial/Pool_Party/prep | 4 +- 4 files changed, 18 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index aa31c0b1..e6335612 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,7 @@ var/ .viminfo .pytest_cache/ *.deb -devops/build-scripts/xenial/Pool_Party/Docker-r +Docker-r Pipfile # PyInstaller diff --git a/build_indy_pool b/build_indy_pool index 8c2c7e40..b1db3f32 100755 --- a/build_indy_pool +++ b/build_indy_pool @@ -2,37 +2,20 @@ export MAKE=/usr/bin/make -red=`tput setaf 1` -green=`tput setaf 2` -reset=`tput sgr0` -printf "\n${red}BEGIN BUILDING:\t${green}sovtoken.deb\n" -sov_token=$(eval "SRC_DIR_NAME=sovtoken make -C devops/ package_in_docker" ) -printf "${reset}SUCCESS:\t${green}sovtoken.deb built\n\n" - -printf "${red}BEGIN BUILDING:\t${green}sovtokenfees.deb\n" -sov_token_fees=$(eval "SRC_DIR_NAME=sovtokenfees make -C devops/ package_in_docker" 2> /dev/null) -printf "${reset}SUCCESS:\t${green}sovtokenfees.deb built\n\n" +# This creates the docker containers that are used for packing +sov_token=$(eval "SRC_DIR_NAME=sovtoken make -C devops/ package_in_docker") +sov_token_fees=$(eval "SRC_DIR_NAME=sovtokenfees make -C devops/ package_in_docker") +# if the dockerfile is outdated this will update it with current version number prep=$(./devops/build-scripts/xenial/Pool_Party/prep) - -printf "${red}MOVING: ${green}sovtoken.deb to devops/build-scripts/xenial/Pool_Party/\n" +# the script calls for debians to be in the Pool_Party directory and this moves them there mv devops/_build/sovtoken/*.deb devops/build-scripts/xenial/Pool_Party/. - -printf "${red}MOVING: ${green}sovtoken.deb to devops/build-scripts/xenial/Pool_Party/\n" mv devops/_build/sovtokenfees/*.deb devops/build-scripts/xenial/Pool_Party/. -printf "\n${reset}FILES HAVE BEEN MOVED SUCCESSFULLY\n" - +# change to correct directory and begin building the pool cd devops/build-scripts/xenial/Pool_Party/ -printf "\n${red}BEGIN BUILDING:${green} payment ledger${reset}\nPlease Be Patient RocksDB and the Payment Ledger are being built\n\n" -docker build -t indy_pool . > /dev/null & PID=$! -printf "[" -while kill -0 $PID 2> /dev/null; do - printf "▓" - sleep 1 -done -printf "]\n\nBUILD COMPLETE\n\n" -printf "${red}RUNNING:\t${green} payment ledger\n" -docker run -itd -p 9701-9708:9701-9708 indy_pool > /dev/null -printf "${green}Success:\t${reset} payment ledger is now ready to use\n" +docker build -t indy_pool . + +# build and expose container +docker run -itd -p 9701-9708:9701-9708 indy_pool diff --git a/devops/build-scripts/xenial/Pool_Party/Dockerfile b/devops/build-scripts/xenial/Pool_Party/Dockerfile index bf07f7c3..9bfbbe54 100644 --- a/devops/build-scripts/xenial/Pool_Party/Dockerfile +++ b/devops/build-scripts/xenial/Pool_Party/Dockerfile @@ -56,8 +56,9 @@ ARG python3_indy_crypto_ver=0.4.1 ARG indy_crypto_ver=0.4.0 ARG indy_plenum_ver=1.6.50 -ARG sovtoken_pkg_name=sovtoken_0.9.1_amd64.deb -ARG sovtokenfees_pkg_name=sovtokenfees_0.9.1_amd64.deb +# this should be left blank because the prep will supply the correct version number +ARG sovtoken_pkg_name= +ARG sovtokenfees_pkg_name= COPY ${sovtoken_pkg_name} /root COPY ${sovtokenfees_pkg_name} /root @@ -66,8 +67,8 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 RUN echo "deb https://repo.sovrin.org/deb xenial $indy_stream" >> /etc/apt/sources.list RUN apt-get update -y && apt-get install -y \ - indy-plenum \ - indy-node \ + indy-plenum=${indy_plenum_ver} \ + indy-node=${indy_node_ver} \ indy-anoncreds=${indy_anoncreds_ver} \ python3-indy-crypto=${python3_indy_crypto_ver} \ libindy-crypto=${indy_crypto_ver} \ diff --git a/devops/build-scripts/xenial/Pool_Party/prep b/devops/build-scripts/xenial/Pool_Party/prep index a422011f..1c834955 100755 --- a/devops/build-scripts/xenial/Pool_Party/prep +++ b/devops/build-scripts/xenial/Pool_Party/prep @@ -10,6 +10,6 @@ echo "Your current sovtoken debian package: $fpn \n" echo "summoning warlocks to correct debian package names in the pool dockerfile\n" -sed -i -r "s~sovtoken_pkg_name=sovtoken_0.9.0_amd64.deb~sovtoken_pkg_name=$tpn~" "devops/build-scripts/xenial/Pool_Party/Dockerfile" +sed -i -r "s/sovtoken_pkg_name=/sovtoken_pkg_name=$tpn/" "devops/build-scripts/xenial/Pool_Party/Dockerfile" +sed -i -r "s/sovtokenfees_pkg_name=/sovtokenfees_pkg_name=$tpn/" "devops/build-scripts/xenial/Pool_Party/Dockerfile" -sed -i -r "s~sovtokenfees_pkg_name=sovtokenfees_0.9.0_amd64.deb~sovtokenfees_pkg_name=$fpn~" "devops/build-scripts/xenial/Pool_Party/Dockerfile"