Skip to content

Commit

Permalink
Update taginfo script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Apr 6, 2024
1 parent a653a5a commit df48d10
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions images/taginfo/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand All @@ -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

0 comments on commit df48d10

Please sign in to comment.