chore: add default config for mock machines
This commit is contained in:
parent
8b53644f14
commit
5bd116c208
3 changed files with 3 additions and 10 deletions
|
|
@ -116,7 +116,7 @@
|
||||||
"admin-server": "nodemon bin/lamassu-admin-server --dev",
|
"admin-server": "nodemon bin/lamassu-admin-server --dev",
|
||||||
"graphql-server": "nodemon bin/new-graphql-dev-insecure",
|
"graphql-server": "nodemon bin/new-graphql-dev-insecure",
|
||||||
"watch": "concurrently \"npm:server\" \"npm:admin-server\" \"npm:graphql-server\"",
|
"watch": "concurrently \"npm:server\" \"npm:admin-server\" \"npm:graphql-server\"",
|
||||||
"stress-test": "cd ./test/stress/ && node index.js 5 -v"
|
"stress-test": "cd ./test/stress/ && node index.js 50 -v"
|
||||||
},
|
},
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
|
|
||||||
|
|
@ -45,19 +45,12 @@ EOL
|
||||||
DEVICE_ID=`openssl x509 -outform der -in ./machines/$NUMBER/client.pem | sha256sum | cut -d " " -f 1`
|
DEVICE_ID=`openssl x509 -outform der -in ./machines/$NUMBER/client.pem | sha256sum | cut -d " " -f 1`
|
||||||
|
|
||||||
# Update db config
|
# Update db config
|
||||||
sudo -u postgres psql -t -d lamassu_stress -c "select data from user_config where type='config' order by id desc limit 1" > config.json
|
|
||||||
if [[ -s config.json ]]
|
|
||||||
then
|
|
||||||
NEW_CONFIG=$(node ./utils/save-config.js $NUMBER $DEVICE_ID)
|
NEW_CONFIG=$(node ./utils/save-config.js $NUMBER $DEVICE_ID)
|
||||||
sudo -u postgres psql "lamassu_stress" << EOF
|
sudo -u postgres psql "lamassu_stress" << EOF
|
||||||
insert into user_config(type, data, created, valid)
|
insert into user_config(type, data, created, valid)
|
||||||
values('config', '$NEW_CONFIG', now(), 't')
|
values('config', '$NEW_CONFIG', now(), 't')
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
else
|
|
||||||
echo "file is empty"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Add device on db
|
# Add device on db
|
||||||
sudo -u postgres psql "lamassu_stress" << EOF
|
sudo -u postgres psql "lamassu_stress" << EOF
|
||||||
insert into devices(device_id, cashbox, cassette1, cassette2, paired, display, created, name, last_online, location)
|
insert into devices(device_id, cashbox, cassette1, cassette2, paired, display, created, name, last_online, location)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
const old = require('../config.json')
|
const config = require('./default-config.json')
|
||||||
|
|
||||||
console.log(JSON.stringify(old))
|
console.log(JSON.stringify(config))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue