From b9695d445af49b001c934ce7f6f2c96ec0346af1 Mon Sep 17 00:00:00 2001 From: "Sheng Chuan (Michael) Hsu" Date: Sat, 31 Jul 2021 19:46:41 +0800 Subject: [PATCH] modify dockerfile and script --- scripts/Dockerfile | 8 ++++---- scripts/runScript.sh | 4 ++-- server/package.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/Dockerfile b/scripts/Dockerfile index 4b145b0..d27ecd0 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -6,10 +6,10 @@ COPY ./server /app/server # build WORKDIR /app/server -RUN npm install -RUN npm build -RUN echo "01 01-13 * * 1-5 node /app/server/lib/index.js" >> crontab.tmp \ +RUN yarn +RUN yarn tsc +RUN echo "01 01-13 * * 1-5 node /app/server/lib/main.js" >> crontab.tmp \ && crontab crontab.tmp \ && rm -rf crontab.tmp -CMD ["crond","-f"] \ No newline at end of file +CMD ["crond","-f"] diff --git a/scripts/runScript.sh b/scripts/runScript.sh index 82fd9a9..7dae441 100644 --- a/scripts/runScript.sh +++ b/scripts/runScript.sh @@ -2,8 +2,8 @@ if [ -f "./server/src/configs/serviceAccountKey.json" ]; then docker build -f scripts/Dockerfile -t jira2notion:latest . - docker stop jira2notion - docker rm jira2notion + docker stop jira2notion || true + docker rm jira2notion || true docker run --name jira2notion -dit jira2notion docker image prune -f else diff --git a/server/package.json b/server/package.json index 7aa06a0..53df191 100644 --- a/server/package.json +++ b/server/package.json @@ -29,9 +29,9 @@ }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "build": "tsc", + "tsc": "tsc", "dev": "node lib/main.js", - "start": "npm run build && npm run dev", + "start": "yarn tsc && yarn dev", "lint": "eslint . --ext .ts", "prepare": "cd .. && husky install server/.husky" }