forked from steemit/steem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create Dockerfile and bash script to build and deploy smoketest docke…
…r container
- Loading branch information
1 parent
f82f92a
commit de82be2
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Dockerfile | ||
README.md | ||
docker_build_and_ruu.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |