diff --git a/images/taginfo/start.sh b/images/taginfo/start.sh index 79405dca..73ea90d4 100755 --- a/images/taginfo/start.sh +++ b/images/taginfo/start.sh @@ -83,11 +83,14 @@ update() { # Link to download db zip files chmod a=r $UPDATE_DIR/download ln -sf $UPDATE_DIR/download $WORKDIR/taginfo/web/public/download + # Upload db to s3 + aws s3 sync $DATA_DIR s3://$AWS_S3_BUCKET/$ENVIRONMENT --exclude "*" --include "*.db" } start_web() { while true; do echo "Start...Taginfo web service" + aws s3 sync s3://$AWS_S3_BUCKET/$ENVIRONMENT $DATA_DIR/ NUM_DB_FILES=$(ls $DATA_DIR/*.db | wc -l) if [ $NUM_DB_FILES -ge 7 ]; then cd /apps/taginfo/web && bundle exec rackup --host 0.0.0.0 -p 80 & @@ -97,12 +100,12 @@ start_web() { done } - ACTION=$1 +set_taginfo_config +updates_source_code +mkdir -p $DATA_DIR/update/log/ if [ "$ACTION" = "web" ]; then start_web elif [ "$ACTION" = "data" ]; then - set_taginfo_config - updates_source_code update fi