deployment stuff

This commit is contained in:
tmont 2020-04-27 21:14:33 -07:00
parent 11b08e47f8
commit b656adc23d
6 changed files with 34 additions and 3 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
.idea
node_modules
public/
COVID-19/

1
.nvmrc Normal file
View File

@ -0,0 +1 @@
12.16.2

4
deploy.sh Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
scp -r ./data ./tmpl generate.js update.sh package.json yarn.lock .nvmrc \
tmont.com:/var/www/sites/covid19.tmont.com

View File

@ -8,7 +8,7 @@ const pug = require('pug');
const publicDir = path.join(__dirname, 'public');
const templatesDir = path.join(__dirname, 'tmpl');
const dataDir = path.join(__dirname, 'data');
const covidDataDir = path.resolve(path.join(__dirname, '..', 'COVID-19', 'csse_covid_19_data'));
const covidDataDir = path.resolve(path.join(__dirname, 'COVID-19', 'csse_covid_19_data'));
const timeSeriesDir = path.join(covidDataDir, 'csse_covid_19_time_series');
const promiseMe = (fn) => {

View File

@ -7,7 +7,9 @@
"bootstrap": "4.4.1",
"chart.js": "2.9.3",
"csv-parse": "4.8.9",
"pug": "2.0.4",
"pug": "2.0.4"
},
"devDependencies": {
"serve": "11.3.0"
}
}

24
update.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${dir}"
. /home/tmont/.nvm/nvm.sh
nvm use
yarn install --production --non-interactive --pure-lockfile
if [[ ! -d "./COVID-19" ]]; then
git clone --depth 1 https://github.com/CSSEGISandData/COVID-19.git
else
(cd COVID-19 && git pull)
fi
rm -rf ./public/
./generate.js
rsync -va ./public/ ./live/
echo $(date)
echo