Skip to content

Commit

Permalink
get wait-for-it from remote and fixed did_insert
Browse files Browse the repository at this point in the history
  • Loading branch information
FIL1994 committed Jul 6, 2019
1 parent 54ce8f8 commit 1cad2f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 190 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
server/target
traffic_records/target
traffic/target
did_insert.txt
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ EXPOSE 8080
RUN mkdir -p /usr/local/app/
WORKDIR /usr/local/app/
COPY . /usr/local/app/
RUN mkdir -p /usr/local/test/
RUN rm -f did_insert.txt

WORKDIR /usr/local/app/scripts
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh wait-for-it.sh
RUN ./insert_data.sh

WORKDIR /usr/local/app/
WORKDIR /usr/local/app/
15 changes: 8 additions & 7 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

echo "starting"

if test ! -f "did_insert.txt"
# wait for mongodb to start
./scripts/wait-for-it.sh mongo:27017 -t 30

if test ! -f "/did_insert.txt"
then
echo "inserting..."
# wait for mongodb to start
./scripts/wait-for-it.sh mongo:27017 -t 30
echo "inserting...""
cd /usr/local/app/traffic_records
cargo run --release
touch ../did_insert.txt
cargo run
touch /did_insert.txt
fi
cd /usr/local/app/server
cargo run --release
cargo run
4 changes: 2 additions & 2 deletions scripts/insert_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

if ./download.sh; then
cd ../traffic_records
cargo build --release
cargo build
cd ../server
cargo build --release
cargo build
else
echo failed
exit 1
Expand Down
178 changes: 0 additions & 178 deletions scripts/wait-for-it.sh

This file was deleted.

0 comments on commit 1cad2f2

Please sign in to comment.