Skip to content

Commit c60baba

Browse files
committed
Fix startup scripts on project IDX platform.
1 parent 176c978 commit c60baba

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.idx/dev.nix

+6-5
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
mongoimport --db json_scada --collection users --type json --file ~/json-scada/demo-docker/mongo_seed/files/demo_users.json
9393
";
9494
init-postgresql = "
95+
mkdir -p ~/json-scada/grafana/data &&
96+
mkdir -p ~/json-scada/grafana/logs &&
97+
mkdir -p ~/json-scada/grafana/plugins
9598
mkdir -p ~/json-scada/log &&
9699
mkdir -p ~/postgres &&
97100
initdb -D ~/postgres &&
@@ -101,11 +104,7 @@
101104
/usr/bin/createuser -h localhost -s postgres ;
102105
psql -U postgres -w -h localhost -f ~/json-scada/sql/create_tables.sql template1 &&
103106
psql -U postgres -w -h localhost -f ~/json-scada/sql/metabaseappdb.sql metabaseappdb &&
104-
psql -U postgres -w -h localhost -f ~/json-scada/sql/grafanaappdb.sql grafanaappdb &&
105-
mkdir -p ~/json-scada/grafana/data &&
106-
mkdir -p ~/json-scada/grafana/logs &&
107-
mkdir -p ~/json-scada/grafana/plugins &&
108-
grafana server target --config ~/json-scada/platform-nix-idx/grafana.ini --homepath /nix/store/454jp6ww3nr2k7jxfp4il4a3l9kq0l3h-grafana-10.2.8/share/grafana/
107+
psql -U postgres -w -h localhost -f ~/json-scada/sql/grafanaappdb.sql grafanaappdb
109108
";
110109
build-jsonscada = "
111110
cd ~/json-scada/platform-linux &&
@@ -125,6 +124,8 @@
125124
# Example: start a background task to watch and re-build backend code
126125
# watch-backend = "npm run watch-backend";
127126
start-mongodb = "/usr/bin/mongod -f ~/json-scada/platform-nix-idx/mongod.conf";
127+
start-postgresql = "/usr/bin/pg_ctl -D /home/user/postgres start >/dev/null 2>&1";
128+
start-grafana = "grafana server target --config ~/json-scada/platform-nix-idx/grafana.ini --homepath /nix/store/454jp6ww3nr2k7jxfp4il4a3l9kq0l3h-grafana-10.2.8/share/grafana/ >/dev/null 2>&1 &";
128129
start-supervisor = "supervisord -c ~/json-scada/platform-nix-idx/supervisord.conf";
129130
};
130131
};

0 commit comments

Comments
 (0)