CGUC / skybunk-server

The back-end application for Conrad Grebel University College students to stay connected
3 stars 9 forks source link

Helper scripts for dev setup #120

Closed mipollex closed 4 years ago

mipollex commented 4 years ago

I've created two scripts to aid in developer setup. These two scripts should be used as such:

# Ensure auth-server is running either locally or the dev auth server (The first script checks this anyway)

# Create the server record on the auth-server
node registerServer.js

# Start the server with the environment variables printed out by the previous script
npm start

# Create and register an admin user using the other script
node createAdminUser.js

These new scripts do not currently take input from the user, so any values should be modified inline during use (I was too lazy at the time of writing to do this). If there's enough interest I have no problems adding command-line arguments or just a simple means of querying the user for values.

picklechips commented 4 years ago

Scripts look good - just a couple questions surrounding usability. 1) Are there docs for these anywhere? 2) Might it be useful to create a bash script to run these? I'm thinking maybe we can change npm start to run a custom bash script which will run registerServer if ones not already registered, start the server, and then createAdminUser if one doesn't already exist or something.

So then you can always just start the server using npm start and it will automatically do the setup if its needed

mipollex commented 4 years ago

Scripts look good - just a couple questions surrounding usability.

  1. Are there docs for these anywhere?
  2. Might it be useful to create a bash script to run these? I'm thinking maybe we can change npm start to run a custom bash script which will run registerServer if ones not already registered, start the server, and then createAdminUser if one doesn't already exist or something.

So then you can always just start the server using npm start and it will automatically do the setup if its needed

No, there is currently no documentation. I've been swamped with other schoolwork, and haven't had time to throw together a comprehensive set of instructions. I wouldn't mind spending my Tuesday "skybunk time" on better docs though