Added scripts for server deployment
This commit is contained in:
parent
208dfacb29
commit
f73e46b5e6
2 changed files with 34 additions and 0 deletions
18
carburants.service
Normal file
18
carburants.service
Normal file
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=API Carburants!
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Environment="PORT=3666"
|
||||
Type=simple
|
||||
User=dbroqua
|
||||
Group=dbroqua
|
||||
UMask=007
|
||||
WorkingDirectory=/home/dbroqua/carburants/api
|
||||
ExecStart=yarn start
|
||||
Restart=on-failure
|
||||
TimeoutStopSec=300
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
16
cron.sh
Executable file
16
cron.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#! /bin/bash
|
||||
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
|
||||
cd ${SCRIPTPATH}
|
||||
mkdir ./public
|
||||
cd ./public
|
||||
wget https://donnees.roulez-eco.fr/opendata/jour
|
||||
unzip jour
|
||||
mv PrixCarburants_quotidien*.xml gas-stations.xml
|
||||
rm jour
|
||||
|
||||
cd ../
|
||||
|
||||
node importGasStations.js
|
||||
|
Loading…
Reference in a new issue