Skip to content

Commit

Permalink
create Dockerfile and bash script to build and deploy smoketest docke…
Browse files Browse the repository at this point in the history
…r container
  • Loading branch information
mkochanowicz committed Mar 28, 2018
1 parent f82f92a commit de82be2
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/smoketest/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dockerfile
README.md
docker_build_and_ruu.sh
31 changes: 31 additions & 0 deletions tests/smoketest/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM phusion/baseimage:0.9.19

ARG STOP_REPLAY_AT_BLOCK

ENV LANG=en_US.UTF-8
ENV WDIR=/usr/local/steem
ENV SMOKETEST=$WDIR/smoketest
ENV STOP_REPLAY_AT_BLOCK=$STOP_REPLAY_AT_BLOCK

RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y libreadline-dev
RUN apt-get install -y python3
RUN apt-get install -y python3-pip
RUN pip3 install --upgrade pip
RUN pip3 install pyresttest

COPY . $SMOKETEST

RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#reference: volume points to reference steemd
#tested: volume points to tested steemd
#ref_blockchain: volume points to reference folder, where blockchain folder exists
#tested_blockchain: volume points to tested folder, where blockchain folder exists
VOLUME ["reference", "tested", "ref_blockchain", "tested_blockchain"]

#CMD pyresttest
CMD cd $SMOKETEST && \
./smoketest.sh /reference/steemd /tested/steemd /ref_blockchain /tested_blockchain $STOP_REPLAY_AT_BLOCK
29 changes: 29 additions & 0 deletions tests/smoketest/docker_build_and_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
#params:
# - ref steemd location
# - tested steemd location
# - ref blockchain folder location
# - tested blockchain folder location
# - stop replay at block
#
# sudo ./docker_build_and_run.sh ~/steemit/steem/build/Release/programs/steemd ~/steemit/steem/build/Release/programs/steemd ~/steemit/steemd_data/steemnet ~/steemit/steemd_data/steemnet

if [ $# -ne 5 ]
then
echo "Usage: reference_steemd_location tested_steemd_location ref_blockchain_folder_location tested_blockchain_folder_location stop_replay_at_block"
echo "Example: ~/steemit/ref_steemd ~/steemit/steem/build/Release/programs/steemd ~/steemit/steemnet ~/steemit/testnet 5000000"
exit -1
fi

echo $*

docker build --build-arg STOP_REPLAY_AT_BLOCK=$5 -t smoketest .
[ $? -ne 0 ] && echo docker build FAILED && exit -1

docker system prune -f

#docker run -v $1:/reference -v $2:/tested -v $3:/ref_blockchain -v $4:/tested_blockchain \
# -it smoketest:latest /bin/bash
docker run -v $1:/reference -v $2:/tested -v $3:/ref_blockchain -v $4:/tested_blockchain \
smoketest:latest
[ $? -ne 0 ] && echo docker run FAILED && exit -1

0 comments on commit de82be2

Please sign in to comment.