Skip to content

Commit

Permalink
Add purge script
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutger van Deelen committed May 18, 2020
1 parent 05f0041 commit 0c09bcc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion purge-streamer-ui-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ if [ -z "$1" ]; then
fi

echo "Purge streamer ui db ..."
set -a && source env.sh && set +a && curl -X POST -u $STREAMER_UI_DB_USER:$STREAMER_UI_DB_PASSWORD -i -H 'Accept:application/json' $1/purge
set -a && source env.sh && set +a && curl -X POST -u $STREAMER_UI_DB_USER:$STREAMER_UI_DB_PASSWORD -i -H 'Content-Type: application/json' $1/purge
4 changes: 3 additions & 1 deletion streamer-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@ RUN yarn build

# Create the server
FROM node:12
RUN apt-get update && apt-get install -y cron
RUN apt-get update && apt-get install -y cron curl
WORKDIR /opt/streamer-ui-server
COPY $pwd/packages/server/package.json ./
COPY $pwd/packages/server/yarn.lock ./
RUN yarn install
COPY $pwd/packages/server/purge-db.sh ./
COPY $pwd/packages/server/start-server.sh ./
COPY $pwd/packages/server/*.js ./
COPY $pwd/packages/server/bin ./bin
COPY $pwd/packages/server/routes ./routes
COPY $pwd/packages/server/config ./config
RUN ( chmod +x purge-db.sh )
RUN ( chmod +x start-server.sh )
COPY --from=build /opt/streamer-ui-client/build /opt/streamer-ui-server/frontend
CMD [ "/opt/streamer-ui-server/start-server.sh" ]
7 changes: 7 additions & 0 deletions streamer-ui/packages/server/purge-db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

credentials=$STREAMER_UI_DB_USER:$STREAMER_UI_DB_PASSWORD
url=https://$STREAMER_UI_HOST:$STREAMER_UI_PORT

echo "Purge streamer ui db ..."
curl -X POST -u $credentials -i -H 'Content-Type: application/json' $url

0 comments on commit 0c09bcc

Please sign in to comment.